ucsb-cs56-projects / cs56-games-dealer

-
0 stars 8 forks source link

What happens when the whole deck is dealt? #5

Closed kjorg50 closed 10 years ago

kjorg50 commented 10 years ago

Right now the dealer continues to ask if you want more cards, even when all 52 cards have been dealt. Only once you have selected all 52 cards and then answer n to the prompt Do you want to continue? (y/n) does it tell you that there are no more cards in the deck. If you select y even when you have all 52 cards, the dealer still keeps going, but this doesn't really make sense.

Make a smarter dealer that knows when the deck is out of cards. For example, it could output something like "No cards left" or "All the cards are gone!" when whole deck is dealt, regardless of whether the user wants to continue or not. Then you can prompt the user if they want to start a new hand, and the deck will be reset.

~estimated 50