exercism / rust

Exercism exercises in Rust.
https://exercism.org/tracks/rust
MIT License
1.47k stars 520 forks source link

Poker problem refers to non-specific Wikipedia rules #1521

Closed asarkar closed 1 year ago

asarkar commented 2 years ago

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.

coriolinus commented 2 years ago

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.

senekor commented 1 year ago

Belongs in problem specs, where this issue already exists: https://github.com/exercism/problem-specifications/issues/2153