From a1a5cfac208bb22e5821d0110e179bc838b24bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 11 Oct 2024 21:37:48 +0200 Subject: [PATCH] bugfix: properly copy set instead of using ref --- src/hanabi/solvers/deck_analyzer.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/hanabi/solvers/deck_analyzer.py b/src/hanabi/solvers/deck_analyzer.py index abfd62c..a477c8b 100644 --- a/src/hanabi/solvers/deck_analyzer.py +++ b/src/hanabi/solvers/deck_analyzer.py @@ -158,13 +158,12 @@ def analyze(instance: hanab_game.HanabiInstance, only_find_first=False) -> List[ considered_bdr = True stored_cards.add(card) -# logger.verbose("draw pile: {}\nstacks: {}\nstored: {}\nstored crits: {}".format(instance.deck[i+1:], stacks, stored_cards, stored_crits)) - hand_size_left_for_crits = instance.num_players * instance.hand_size - len(stored_crits) - 1 # In case we can only keep the critical cards exactly, get rid of all others if hand_size_left_for_crits == 0: - stored_cards = stored_crits + # Note the very important copy here (!) + stored_cards = stored_crits.copy() squeeze = True # Use a bool flag to only mark this reason once