This program is for learning propose. It help to people that want to practice its criteria hands in poker. The program give a random hand (five cards) to the user and CPU, then user determines who is the winner.
Here are the values from highest to lowest (from https://www.telegraph.co.uk/betting/casino-guides/poker/hand-rankings-chart-cheat-sheet/):
-
Royal flush: The royal flush is the best hand available in poker. It features five consecutive cards, all of the same suit, in order of value from 10 through to ace. Example: [10♥, J♥, Q♥, K♥, A♥]
-
Straight flush: Any five cards of successive values in the same suit that’s not a royal flush is a straight flush. A royal flush or a straight flush with cards of higher ranking are the only hands that can beat a straight flush. Example: [4♣, 5♣, 6♣, 7♣, 8♣]
-
Four of a Kind: Four of the same card in the four suits. The five-card hand is completed by the highest card among the others on the table or in your hand. Example: [A♣, A♠, A♥, A♦, 8♠]
-
Full house: Three of the same value card in three different suits plus a different pair of the same rank card in two different suits in one hand. If more than just one player has a full house the player with the highest value three of a kind will win the hand. Example: [Q♠, Q♥, Q♣, 6♦, 6♠]
-
Flush: Five cards of the same suit in no particular order. If more than one player has a flush, the hand with the highest valued card will win. Example: [4♦, 8♦, 6♦, 7♦, 2♦]
-
Straight: Five cards of consecutive numerical value composed of more than one suit. An ace can normally rank as low (below a 2) or high (above a king) but not at the same time in one hand. Example: [3♠, 4♥, 5♦, 6♣, 7♥]
-
Three of a kind: A poker hand containing three cards of the same rank in three different suits. The two highest available cards besides the three of a kind complete the hand. Example: [K♠, K♥, K♣, 5♠,8♦]
-
Two pair: Two different sets of two cards of matching rank. The highest-ranked left available card completes the hand. Example: [9♠, 9♥, 3♣, 5♦,5♦]
-
Pair: A pair of cards of the same rank in different suits. The remainder of the hand is formed from the three highest-ranked cards available. Example: [9♠, 10♥, 6♣, 6♠, 2♦]
-
High card: The lowest-ranked hand available. The highest card in the hand is your ‘best hand’. In this case it's the king of spades. Example: [4♠, 6♥, K♣, 8♠, 3♦]