Poker hand analyser
Poker hand analyser
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
Parse and rank 5-card poker hands
Create a program to parse a single 5 card poker hand and rank it according to the List of poker hands [1].
Each input card should be specified as a two characters indicating face and suit. For example 2d (two of diamonds).
Faces are: a, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, j, q, k
Suits are: h (hearts), d (diamonds), c (clubs), and s (spades). Or you can use the unicode suit characters: ♥ ♦ ♣ ♠
Duplicate cards are illegal.
The program should analyse a single hand and produce one of the following outputs:
straight-flush, four-of-a-kind, full-house, flush, straight, three-of-a-kind, two-pair, one-pair, high-card
Examples