Skip to content

Commit b752d56

Browse files
Update __init__.py
add push null move
1 parent 1176993 commit b752d56

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cchess/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,9 @@ def uci(self) -> str:
589589

590590
@classmethod
591591
def from_uci(cls, uci: str):
592-
if len(uci) == 4:
592+
if uci == "0000":
593+
return cls.null()
594+
elif len(uci) == 4:
593595
from_square = SQUARE_NAMES.index(uci[0:2])
594596
to_square = SQUARE_NAMES.index(uci[2:4])
595597
return cls(from_square, to_square)

0 commit comments

Comments
 (0)