Fixed check_correct
This commit is contained in:
@@ -133,7 +133,7 @@ class Board:
|
||||
self.bunker, itertools.chain.from_iterable(
|
||||
stack for stack in self.field if stack), ):
|
||||
if isinstance(card, tuple):
|
||||
special_cards[card[0]] += 4 # pylint: disable=E1136
|
||||
special_cards[card[0]] += 4
|
||||
elif isinstance(card, SpecialCard):
|
||||
special_cards[card] += 1
|
||||
elif isinstance(card, NumberCard):
|
||||
@@ -141,8 +141,8 @@ class Board:
|
||||
return False
|
||||
number_cards[card.suit].add(card.number)
|
||||
|
||||
for _, numbers in number_cards.items():
|
||||
if set(range(1, 10)) != numbers:
|
||||
for suit, numbers in number_cards.items():
|
||||
if set(range(self.goal[suit] + 1, 10)) != numbers:
|
||||
return False
|
||||
|
||||
for cardtype, count in special_cards.items():
|
||||
|
||||
@@ -15,8 +15,6 @@ class Action:
|
||||
pass
|
||||
|
||||
def apply(self, action_board: board.Board) -> None:
|
||||
assert self._before_state == 0
|
||||
assert self._after_state == 0
|
||||
if __debug__:
|
||||
self._before_state = action_board.state_identifier
|
||||
self._apply(action_board)
|
||||
|
||||
@@ -71,9 +71,6 @@ def solve(board: Board) -> Iterator[List[board_actions.Action]]:
|
||||
for prev_action in stack.action_stack[-2:-21:-1]:
|
||||
if isinstance(prev_action, MoveAction):
|
||||
if prev_action.cards == action.cards:
|
||||
print("Dropping")
|
||||
print(action)
|
||||
print(prev_action)
|
||||
drop = True
|
||||
if drop:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user