correctly detect bottom deck situations

This commit is contained in:
Maximilian Keßler 2023-12-31 20:17:17 +01:00
parent 7a1adfa178
commit 542d40282a
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -49,9 +49,13 @@ def analyze_replay(instance: hanab_game.HanabiInstance, actions: List[hanab_game
elif card.rank != 1: elif card.rank != 1:
if card in game.deck[game.progress:]: if card in game.deck[game.progress:]:
bdrs.append((card, game.draw_pile_size)) bdrs.append((card, game.draw_pile_size))
if card == game.deck[-1]:
outcomes.add(GameOutcome.bottom_deck)
else: else:
if game.deck[game.progress:].count(card) == 2: if game.deck[game.progress:].count(card) == 2:
bdrs.append((card, game.draw_pile_size)) bdrs.append((card, game.draw_pile_size))
if card == game.deck[-1]:
outcomes.add(GameOutcome.bottom_deck)
for action in actions: for action in actions:
if action.type == hanab_game.ActionType.Discard: if action.type == hanab_game.ActionType.Discard: