diff options
author | Paul Harrison <paul@harrison.sh> | 2022-11-20 13:39:08 +0000 |
---|---|---|
committer | Paul Harrison <paul@harrison.sh> | 2022-12-15 16:02:14 +0000 |
commit | b4ba284dcc20563b9b7dde770b7c9f67c6b25e76 (patch) | |
tree | 7131329e9367c5140f65ebc48ec09ae732261fbb /poker/rank/descriptions.py | |
parent | d924e39608861362e08c5e3706ff46a7a1af919b (diff) |
feat: Construct ranked hand with description
Refactors rank test functions to retern details required for
description, then return RankedHand from rank_hand function.
Diffstat (limited to 'poker/rank/descriptions.py')
-rw-r--r-- | poker/rank/descriptions.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/poker/rank/descriptions.py b/poker/rank/descriptions.py index e69de29..e7f367a 100644 --- a/poker/rank/descriptions.py +++ b/poker/rank/descriptions.py @@ -0,0 +1,14 @@ +from poker.constants import Rank + +DESCRIPTIONS = { + Rank.ROYAL_FLUSH: "royal flush: {suit}", + Rank.STRAIGHT_FLUSH: "straight flush: {high}-high {suit}", + Rank.FOUR_OF_A_KIND: "four of a kind: {value}", + Rank.FULL_HOUSE: "full house: {trips} over {pair}", + Rank.FLUSH: "flush: {suit}", + Rank.STRAIGHT: "straight: {high}-high", + Rank.THREE_OF_A_KIND: "three of a kind: {value}", + Rank.TWO_PAIR: "two pair: {high} and {low}", + Rank.PAIR: "pair: {value}", + Rank.HIGH_CARD: "high card: {value}", +} |