The game rules:
Four cards are placed face-up on the table; Six cards are dealt to each player; The players take turns in playing cards. If the card has the same suit or rank as the topmost card, then the player wins all the cards on the table; When both players have no cards in hand, go to step 2 unless there are no more remaining cards in the card deck. The remaining cards on the table go to the player who won the cards last. In the rare case where none of the players win any cards, then all cards go to the player who played first. When a card with the same suit or rank as the top card on the table is played, the one who tossed it wins all of the cards on the table. The program in this situation should save the cards for the winner before clearing the table of all cards. The program should be keeping track of all cards won by the two players.
The program also counts the points of each player. The cards with the ranks A, 10, J, Q, K get 1 point each, while the player who has the most cards gets three points. If the players have the same number of cards, then the player who played first gets these points. The total points in this game are 23. The player with the most points wins the game.