Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Activity-2/Deck.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ public void shuffle() {
* @return the card just dealt, or null if all the cards have been
* previously dealt.
*/

public Card deal() {
/* *** TO BE IMPLEMENTED IN ACTIVITY 2 *** */
if (isEmpty())
return null;
else {
size--;
return cards.get(size);
}
}


/**
* Generates and returns a string representation of this deck.
* @return a string representation of this deck.
Expand Down