Skip to content

Commit

Permalink
Merge pull request #966 from MarkZH/xboard-alt-resign
Browse files Browse the repository at this point in the history
Support implicit resigning from Xboard engines
  • Loading branch information
niklasf committed Feb 20, 2023
2 parents d13921c + 5859dc2 commit f6deb18
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chess/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,8 @@ def line_received(self, engine: XBoardProtocol, line: str) -> None:
self.play_result.resigned = True
self._ping_after_move(engine)
elif line.startswith("1-0") or line.startswith("0-1") or line.startswith("1/2-1/2"):
if "resign" in line and not self.result.done():
self.play_result.resigned = True
self._ping_after_move(engine)
elif line.startswith("#"):
pass
Expand Down

0 comments on commit f6deb18

Please sign in to comment.