From 542d40282a41ea6834aff99e7f1da0f8a7cf56bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sun, 31 Dec 2023 20:17:17 +0100 Subject: [PATCH] correctly detect bottom deck situations --- src/stats.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stats.py b/src/stats.py index 4950384..724cd9b 100644 --- a/src/stats.py +++ b/src/stats.py @@ -49,9 +49,13 @@ def analyze_replay(instance: hanab_game.HanabiInstance, actions: List[hanab_game elif card.rank != 1: if card in game.deck[game.progress:]: bdrs.append((card, game.draw_pile_size)) + if card == game.deck[-1]: + outcomes.add(GameOutcome.bottom_deck) else: if game.deck[game.progress:].count(card) == 2: bdrs.append((card, game.draw_pile_size)) + if card == game.deck[-1]: + outcomes.add(GameOutcome.bottom_deck) for action in actions: if action.type == hanab_game.ActionType.Discard: