Skip to content

Commit

Permalink
Adjudicate Shatranj game in case of double baring
Browse files Browse the repository at this point in the history
  • Loading branch information
gbtami committed Oct 27, 2024
1 parent a20e11e commit c65d2d6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,16 @@ def result_string_from_value(color, game_result_value):
self.status = DRAW
self.result = "1/2-1/2"

# Shatranj K vs K
# TODO: remove when https://github.com/fairy-stockfish/Fairy-Stockfish/issues/833 resolves
if (
self.variant == "shatranj"
and len([p for p in self.board.fen.split()[0] if p.isalpha()]) == 2
):
self.status = DRAW
self.result = "1/2-1/2"
print("ITT")

if self.status > STARTED:
self.set_crosstable()
self.update_in_plays()
Expand Down

0 comments on commit c65d2d6

Please sign in to comment.