From c65d2d6aa7da1c30020d76168cb03c2e2d01fa65 Mon Sep 17 00:00:00 2001 From: gbtami Date: Sun, 27 Oct 2024 11:00:06 +0100 Subject: [PATCH] Adjudicate Shatranj game in case of double baring --- server/game.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/game.py b/server/game.py index 0bf7bec92..adcd1edb9 100644 --- a/server/game.py +++ b/server/game.py @@ -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()