From ce3d38537f52fda6be5f023724bef987fdd8ec3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 18 Mar 2023 15:18:04 +0100 Subject: [PATCH] add pretty print method for decks --- hanabi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hanabi.py b/hanabi.py index a53a626..09e9c03 100644 --- a/hanabi.py +++ b/hanabi.py @@ -29,6 +29,9 @@ class DeckCard(): # should be injective enough, we never use cards with ranks differing by 1000 return 1000 * self.suitIndex + self.rank +def pp_deck(deck: List[DeckCard]) -> str: + return "[" + ", ".join(card.colorize() for card in deck) + "]" + class ActionType(Enum):