return False
def legal_moves(self):
- positions = []
+ positions = [self.position]
for direction in [BITS.NORTH, BITS.SOUTH, BITS.EAST, BITS.WEST]:
position = self.get_adjacent_position(direction)
if position is not None and self.bits.check_bit(direction):
def test_AcquireWinToken(self):
board = self.make_board(
- player_bits=[BITS.CYAN, BITS.MAGENTA, BITS.YELLOW, BITS.MSB])
+ player_bits=[BITS.CYAN, BITS.MAGENTA, BITS.YELLOW])
state_before = board.export()
actions.AcquireWinToken(set()).perform_action(board, None)
state_after = board.export()
def test_legal_moves_all_available(self):
player = Player(0x0f, (2, 2))
self.assertEqual(
- player.legal_moves(), [(2, 1), (2, 3), (3, 2), (1, 2)])
+ player.legal_moves(), [(2, 2), (2, 1), (2, 3), (3, 2), (1, 2)])
def test_legal_moves_some_unavailable(self):
player = Player(0x0f, (0, 2))
player.bits.clear_bit(BITS.NORTH)
- self.assertEqual(player.legal_moves(), [(0, 3), (1, 2)])
+ self.assertEqual(player.legal_moves(), [(0, 2), (0, 3), (1, 2)])