From 94f3427e1b21ef9242770d4889a67fd024b9c897 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 26 Jan 2013 18:08:37 +0100 Subject: [PATCH] Adjudicate pawn-drop mate as loss in Shogi Mating with a Pawn drop is illegal in Shogi, but rather than burdoning the legality-testing by this complex rule, we simply invert the result for such a mate. After all, Shogi customs are such that everything illegal leads to an immediate loss. --- backend.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index 67e2d1b..2028269 100644 --- a/backend.c +++ b/backend.c @@ -7764,6 +7764,14 @@ Adjudicate (ChessProgramState *cps) case MT_CHECKMATE: reason = "Xboard adjudication: Checkmate"; boards[forwardMostMove][EP_STATUS] = (gameInfo.variant == VariantLosers ? EP_WINS : EP_CHECKMATE); + if(gameInfo.variant == VariantShogi) { + if(forwardMostMove > backwardMostMove + && moveList[forwardMostMove-1][1] == '@' + && CharToPiece(ToUpper(moveList[forwardMostMove-1][0])) == WhitePawn) { + reason = "XBoard adjudication: pawn-drop mate"; + boards[forwardMostMove][EP_STATUS] = EP_WINS; + } + } break; } -- 1.7.0.4