October 2004
Intermediate to advanced
336 pages
6h 27m
English
This function constitutes another component of the Python version of Go Fish. This function checks if the other player has any cards of a specified rank, and if so, it transfers them to the player's hand. If this results in the player having all four cards of that rank, the cards are deleted from the player's hand.
Here's a quick recap of the relevant definitions from the previous example (this function only concerns itself with hands; it does not use the deck):
Cards are identified by their rank and suit: The rank is one of the elements of the list ["2", "3", "4", "5", "6", "7", "8", "9", "10", ...
Read now
Unlock full access