aboutsummaryrefslogtreecommitdiff
path: root/poker/constants.py
diff options
context:
space:
mode:
authorPaul Harrison <paul@harrison.sh>2022-11-20 15:13:16 +0000
committerPaul Harrison <paul@harrison.sh>2022-12-15 16:02:14 +0000
commit9baafc80ed889c232587cf5d4cfaa2db44d1825a (patch)
tree13371c1220a8eabbc0932d30cc9475b98b984c3b /poker/constants.py
parentb4ba284dcc20563b9b7dde770b7c9f67c6b25e76 (diff)
feat: Hand ranking API
Hand ranking API with a health check root endpoint and rank endpoint.
Diffstat (limited to 'poker/constants.py')
-rw-r--r--poker/constants.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/poker/constants.py b/poker/constants.py
index e0a7348..6402ef7 100644
--- a/poker/constants.py
+++ b/poker/constants.py
@@ -17,6 +17,11 @@ class Rank(IntEnum):
PAIR = 9
HIGH_CARD = 10
+ def __str__(self) -> str:
+ """Return string representation."""
+ out: str = self.name.lower().replace("_", " ").title()
+ return out
+
class Suit(AutoName):
"""Card suit enum."""
@@ -46,7 +51,7 @@ class Value(IntEnum):
def __str__(self) -> str:
"""Return string representation."""
- if self.value in [1, 11, 12, 13]:
+ if self.value in [1, 11, 12, 13, 14]:
out: str = self.name.lower()
else:
out = str(self.value)