October 2004
Intermediate to advanced
336 pages
6h 27m
English
This function plays one turn of the game Go Fish. It uses the drawCard() and checkCard() functions (the corrected versions) defined in the previous two parts.
One turn is completed as follows: A rank is randomly selected from the ones that are in the player's hand, and the other hand is interrogated to see if it has any cards of that rank. If it does, they are transferred over. This continues with another card until no card is transferred, at which point the player has to “go fish” and draw a new card from the deck.
Note: The code does not check if the card drawn was the same rank as the last card asked for. ...
Read now
Unlock full access