Update Poker description

Related to Flesh out description of poker exercise · Issue #2153 · exercism/problem-specifications · GitHub

# Instructions

Pick the best hand(s) from a list of poker hands.
Each hand consists of five cards.
A card is represented by a rank followed by a suit.
Ranks are `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `J`, `Q`, `K`, and `A`; suits are `S`, `H`, `D`, and `C`.

For this exercise, only the following hands are available, ranked from strongest to weakest:

| Hand | Description | Example |
| --- | --- | --- |
| Straight flush | Five consecutive ranks, all of the same suit. | `2S 4S 5S 6S 7S` |
| Four of a kind | Four cards of the same rank. | `3S 3H 2S 3D 3C` |
| Full house | Three cards of one rank and two cards of another rank. | `4S 5H 4C 5D 4H` |
| Flush | Five cards of the same suit. | `2S 4S 5S 6S 7S` |
| Straight | Five consecutive ranks. | `3S 4D 2S 6D 5C` |
| Three of a kind | Three cards of the same rank. | `4S 5H 4C 8S 4H` |
| Two pair | Two cards of one rank, two cards of another rank, and one other card. | `4S 5H 4C 8C 5C` |
| One pair | Two cards of the same rank. | `2S 4H 6S 4D JH` |
| High card | Any hand that does not fit another category. | `2S 5H 6S 8D 7H` |

When two hands belong to the same category …

The tie bit is where this breaks down since I don’t understand poker at all. I figure we get this over the finish line together though.

1 Like

…the highest card value (of the cards relevant to that category) wins. For example, 2 3 3 4 5 wins to 2 2 3 4 5. Both have a pair, but the pair of 3s beats a pair of 2s. If the cards relevant to the category match, the rest of the cards are used to break the tie, with the win going to the highest card.

(I think that’s how it works, at least.)

1 Like

Makes sense to me. Our two bits combined become the proposed instructions.

While it technically is not required, people may not know what J, Q, K, A, S, D, H, C stand for. May be in a table or a direct addition to the text.