Skip to content

Commit

Permalink
Update __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmay2004 committed Sep 26, 2020
1 parent fff0198 commit fb998a8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chess/__init__.py
Expand Up @@ -2802,10 +2802,9 @@ def parse_san(self, san: str) -> Move:
"""
# Castling.
try:
san = san.replace('0', 'O')
if san in ["O-O", "O-O+", "O-O#"]:
if san in ["O-O", "O-O+", "O-O#", "0-0", "0-0+", "0-0#"]:
return next(move for move in self.generate_castling_moves() if self.is_kingside_castling(move))
elif san in ["O-O-O", "O-O-O+", "O-O-O#"]:
elif san in ["O-O-O", "O-O-O+", "O-O-O#", "0-0-0", "0-0-0+", "0-0-0#"]:
return next(move for move in self.generate_castling_moves() if self.is_queenside_castling(move))
except StopIteration:
raise ValueError(f"illegal san: {san!r} in {self.fen()}")
Expand Down

0 comments on commit fb998a8

Please sign in to comment.