From 87524addd61b500272c7be7cf52e0603e33e233d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 6 May 2023 22:03:23 +0200 Subject: [PATCH] hanabi.py: support adding arbitrary clues for nicer replays --- hanabi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hanabi.py b/hanabi.py index 048a003..1e3a72a 100644 --- a/hanabi.py +++ b/hanabi.py @@ -188,7 +188,11 @@ class GameState(): def make_action(self, action): match action.type: case ActionType.ColorClue | ActionType.RankClue: - self.clue() + assert(self.clues > 0) + self.actions.append(action) + self.clues -= 1 + self.__make_turn() + # TODO: could check that the clue specified is in fact legal case ActionType.Play: self.play(action.target) case ActionType.Discard: