Java implements poker game


Topic:
4 people A, B, C and D play together - a deck of poker cards, each card is scored according to its number, and cards of the same number in different suits have the same score.
Wherein the playing cards of various suits of 1-10 are respectively 1-10, ], Q, K are recorded as 11, 12, 13 respectively, and king and king are recorded as 20 respectively. The four
suits (diamonds, clubs, hearts, and spades) are recorded as A, B, C, and D, respectively. For example, K of hearts is expressed as 13C, with a score of 13; at 5, it is expressed
as 5A, with a score of 5. The big king is represented as 20K, the score is 20, the little king is represented as 20Q, the score is 20, 54 cards are stacked upside down on the
table.
The game process is as follows:
1. Shuffle: 54 cards are combined in random order.
2. 4-person sorting: Randomly generate the order of 4 people's cards, and the order of cards is the same as the order of cards. The first person takes the card, that is, the first person plays the card.
3. After the 4 people are sorted, form two teams, the first person and the third person form a team according to the order, and the second person and the fourth person form a pair.
4. Divide the cards: Each person takes turns to take cards according to the order of taking the cards. Each person takes 13 cards, and the last two cards are left on the table.
5. Information: Everyone does not know other people's cards, nor do they know the cards left on the table. The information that can be obtained includes the cards they hold and the
cards played by 4 people. Members of the team can communicate the strategy of playing cards in each round.
6. Playing cards: Start playing cards from the first person to get the cards (you can choose the strategy with the greatest chance of winning), 4 people play cards in each round, and then compare
the size, the person with the largest card gets the 4 cards of the current round Card. Cards that have been played cannot be played later. Judgment rules for size, card score
(big) > card score (small), the same card score, according to the order of spades > hearts > clubs > squares to determine the size. For example, 9 of spades>9
of hearts . When comparing the size of cards with a king or a king, the rule of judging the size is king > king > spades 13 > hearts 13 > clubs 13 >
Diamond 13>Spades 1---..Example: In the first round, A gets 3C, B gets 9D,

Guess you like

Origin blog.csdn.net/feng1790291543/article/details/132165165