From e5efe517ee9ce94cbddb336f30a841743c732499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Thu, 10 Oct 2024 13:40:05 +0200 Subject: [PATCH] improve deck analyzer: squeezes --- src/hanabi/solvers/deck_analyzer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hanabi/solvers/deck_analyzer.py b/src/hanabi/solvers/deck_analyzer.py index b42ae3a..1d767fa 100644 --- a/src/hanabi/solvers/deck_analyzer.py +++ b/src/hanabi/solvers/deck_analyzer.py @@ -130,6 +130,10 @@ def analyze(instance: hanab_game.HanabiInstance, only_find_first=False) -> List[ )) return reasons + # In case we can only keep the critical cards exactly, get rid of all others + if num_forced_crit_discards == 0: + stored_cards = stored_crits + # the last - 1 is there because we have to discard 'next', causing a further draw max_remaining_plays = (instance.deck_size - i - 1) + instance.num_players - 1 needed_plays = instance.max_score - sum(stacks)