From 1fbfb851ce740e380fa9a16eb07fe1465af479fa Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 25 Jan 2013 09:55:56 +0100 Subject: [PATCH] Stalemate is a win in Shogi In regular Shogi this never occurs, but in the mini variants it happens often enough. --- backend.c | 2 +- moves.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index 422bdb9..aafb11f 100644 --- a/backend.c +++ b/backend.c @@ -7757,7 +7757,7 @@ Adjudicate (ChessProgramState *cps) boards[forwardMostMove][EP_STATUS] = nrW == nrB ? EP_STALEMATE : ((nrW < nrB) != WhiteOnMove(forwardMostMove) ? EP_CHECKMATE : EP_WINS); - else if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantXiangqi) + else if(gameInfo.variant == VariantShatranj || gameInfo.variant == VariantXiangqi || gameInfo.variant == VariantShogi) boards[forwardMostMove][EP_STATUS] = EP_CHECKMATE; // and in these variants being stalemated loses } break; diff --git a/moves.c b/moves.c index 2b6fd8a..d59542a 100644 --- a/moves.c +++ b/moves.c @@ -1264,7 +1264,7 @@ MateTest (Board board, int flags) else if(gameInfo.variant == VariantGiveaway) return MT_STEALMATE; // no check exists, stalemated = win return inCheck ? MT_CHECKMATE - : (gameInfo.variant == VariantXiangqi || gameInfo.variant == VariantShatranj) ? + : (gameInfo.variant == VariantXiangqi || gameInfo.variant == VariantShatranj || gameInfo.variant == VariantShogi) ? MT_STAINMATE : MT_STALEMATE; } } -- 1.7.0.4