Skip to content

Commit

Permalink
Fixed Board.move_raw bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hrushikeshrv committed Mar 29, 2024
1 parent 0a04254 commit 967e2a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chessengine/bitboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def move_raw(self, start: int, end: int, track: bool = True) -> None:
f"There is no piece at {pos_to_coords[int(log2(start))]} to move."
)
moves = self.get_moves(side=side, piece=piece)
if (start, end) not in moves:
if not any((start, end) == (move[0], move[1]) for move in moves):
raise MoveError(
f"{pos_to_coords[int(log2(start))]} to {pos_to_coords[int(log2(end))]} is not a valid move for {side}"
)
Expand Down

0 comments on commit 967e2a3

Please sign in to comment.