Skip to content

Commit

Permalink
Accept a1a1 as UCI null move (used by lc0, closes #1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Nov 9, 2024
1 parent d625be1 commit 518d662
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def from_uci(cls, uci: str) -> Move:
promotion = PIECE_SYMBOLS.index(uci[4]) if len(uci) == 5 else None
except ValueError:
raise InvalidMoveError(f"invalid uci: {uci!r}")
if from_square == to_square:
if from_square == to_square and from_square != A1:
raise InvalidMoveError(f"invalid uci (use 0000 for null moves): {uci!r}")
return cls(from_square, to_square, promotion=promotion)
else:
Expand Down

0 comments on commit 518d662

Please sign in to comment.