rust
rust copied to clipboard
Poker problem refers to non-specific Wikipedia rules
Poker refers to Wikipedia for the rules, but there's no specific/clear rule in Wikipedia. For example:
A straight flush is a hand that contains five cards of sequential rank, all of the same suit, such as Q♥ J♥ 10♥ 9♥ 8♥ (a "queen-high straight flush").[4] It ranks below five of a kind and above four of a kind.[5] Under high rules, an ace can rank either high (as in A♥ K♥ Q♥ J♥ 10♥, an ace-high straight flush) or low (as in 5♦ 4♦ 3♦ 2♦ A♦, a five-high straight flush), but cannot simultaneously rank both high and low (so Q♣ K♣ A♣ 2♣ 3♣ is an ace-high flush, but not a straight).[6][13] Under deuce-to-seven low rules, an ace always ranks high (so 5♠ 4♠ 3♠ 2♠ A♠ is an ace-high flush). Under ace-to-six low rules, an ace always rank low (so A♥ K♥ Q♥ J♥ 10♥ is a king-high flush).[14] Under ace-to-five low rules, straight flushes are not possible (so 9♣ 8♣ 7♣ 6♣ 5♣ is a nine-high hand).[7]
Few of many different interpretations are given below:
Under high rules, an ace can rank either high
Under ace-to-six low rules, an ace always rank low
The question doesn't say, so, the student has no way of knowing which of these many rulesets should be used to solve this problem. And this is just one hand, all of the other hands are defined in a similarly confusing way.
The problem can be clearly defined by actually stating the rules the author has in mind in the question.
Specifically, the instructions at https://github.com/exercism/rust/blob/main/exercises/practice/poker/.docs/instructions.md point to this Wiki page.
High rules are in use for this exercise. This could usefully be added to the problem documentation.
Belongs in problem specs, where this issue already exists: https://github.com/exercism/problem-specifications/issues/2153