GIN RUMMY CARD GAME

Game Description:
rove your skills and beat your opponent! At the beginning of this game each of the two players
will be dealt 10 cards, while 1 upturned card will be dealt to the discard pile in the middle
of the table, and the remaining cards are downturned and placed to the stock pile on the left
of the discard pile. You start the round by picking either the card on the discard pile or the
card on the stock pile, then discard a card from your hand to the discard pile. The computer
then follows suit and the game continues. Your hand forms melds and deadwoods, and your goal
in the game is to reduce the deadwood points. Melds are 3 or 4 cards of the same rank, or 3
or more cards of the same suit in sequence. Melds cannot overlap so one card cannot belong
to two melds. The remaining cards that cannot be matched are called deadwoods. Each deadwood
card carries deadwood points, A has 1 point, 2 has 2 points, etc, and J, Q, K carry 10
points each. After discarding a card, you can end the round by knocking if your deadwood
point is less than or equal to 10. Then the computer can have a chance to lay off its
deadwood cards if they can form melds with those of yours. After that, if your deadwood
point is less than the computer's, you will be awarded a score equal to the difference
in the deadwood points. But if the computer has a smaller deadwood point, this is
called an “undercut” and the computer will receive 25 points plus the difference
in the deadwood points. If you have no deadwood then the computer is not allowed to
lay off, and an extra 25 points will be added to your score. And if all the 11 cards
in your hand form valid melds, you can knock before discarding a card and you will
receive extra 6 points. The game ends when the score of a player reaches 100.
If only 2 cards remain in the stock pile, then the game ends in a draw. Form as
many melds as you can to become the champion of Gin Rummy!