Poker hand analyser: Difference between revisions
Content added Content deleted
(Added Elixir) |
m (added a ;Task: (bold) header, made other wording changes to the task's preamble (spelled-out some numbers).) |
||
Line 1: | Line 1: | ||
{{draft task}} |
{{draft task}} |
||
[[Category:Cards]] |
|||
⚫ | |||
[[Category:Games]] |
|||
;Task: |
|||
⚫ | |||
⚫ | |||
⚫ | |||
Each input card has two characters indicating face and suit. |
Each input card has two characters indicating face and suit. |
||
Line 14: | Line 19: | ||
Duplicate cards are illegal. |
Duplicate cards are illegal. |
||
The program should |
The program should analyze a single hand and produce one of the following outputs: |
||
straight-flush |
straight-flush |
||
four-of-a-kind |
four-of-a-kind |
||
Line 28: | Line 32: | ||
Examples: |
Examples: |
||
2♥ 2♦ 2♣ k♣ q♦: three-of-a-kind |
2♥ 2♦ 2♣ k♣ q♦: three-of-a-kind |
||
2♥ 5♥ 7♦ 8♣ 9♠: high-card |
2♥ 5♥ 7♦ 8♣ 9♠: high-card |
||
Line 41: | Line 44: | ||
The programs output for the above examples should be displayed here on this page. |
The programs output for the above examples should be displayed here on this page. |
||
⚫ | |||
;Extra credit: |
|||
# use the playing card characters introduced with Unicode 6.0 (U+1F0A1 - U+1F0DE). |
# use the playing card characters introduced with Unicode 6.0 (U+1F0A1 - U+1F0DE). |
||
# allow two jokers |
# allow two jokers |
||
Line 48: | Line 52: | ||
::* five-of-a-kind would then be the highest hand |
::* five-of-a-kind would then be the highest hand |
||
Extra Credit 2. Examples: |
|||
⚫ | |||
joker 2♦ 2♠ k♠ q♦: three-of-a-kind |
joker 2♦ 2♠ k♠ q♦: three-of-a-kind |
||
joker 5♥ 7♦ 8♠ 9♦: straight |
joker 5♥ 7♦ 8♠ 9♦: straight |
||
Line 63: | Line 67: | ||
joker Q♦ joker A♦ 10♦: straight-flush |
joker Q♦ joker A♦ 10♦: straight-flush |
||
joker 2♦ 2♠ joker q♦: four-of-a-kind |
joker 2♦ 2♠ joker q♦: four-of-a-kind |
||
<br><br> |
|||
=={{header|C++}}== |
=={{header|C++}}== |