From b4ba284dcc20563b9b7dde770b7c9f67c6b25e76 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Sun, 20 Nov 2022 13:39:08 +0000 Subject: feat: Construct ranked hand with description Refactors rank test functions to retern details required for description, then return RankedHand from rank_hand function. --- poker/rank/descriptions.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'poker/rank/descriptions.py') 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}", +} -- cgit v1.2.3