From: H.G. Muller Date: Mon, 5 Jul 2010 07:51:53 +0000 (+0200) Subject: Adjudicate Xiangqi material draws with Advisor-less Cannons X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6a5089a4fa20889fe9292d2187cf676fe2338303;p=xboard.git Adjudicate Xiangqi material draws with Advisor-less Cannons Used the Queen counter for counting Cannons. Note that material draws with stale Pawns (i.e. on the back rank) are not yet adjudicated. --- diff --git a/backend.c b/backend.c index 2df9b7d..95563f0 100644 --- a/backend.c +++ b/backend.c @@ -6640,8 +6640,10 @@ Adjudicate(ChessProgramState *cps) case BlackRook: NrBR++; break; case WhiteQueen: + case WhiteCannon: NrWQ++; break; case BlackQueen: + case BlackCannon: NrBQ++; break; case EmptySquare: break; @@ -6763,7 +6765,10 @@ Adjudicate(ChessProgramState *cps) if( NrPieces == 2 || gameInfo.variant != VariantXiangqi && gameInfo.variant != VariantShatranj && // [HGM] baring will remain possible (NrPieces == 3 && NrWN+NrBN+NrWB+NrBB == 1 || - NrPieces == NrBB+NrWB+2 && bishopsColor != 3)) // [HGM] all Bishops (Ferz!) same color + NrPieces == NrBB+NrWB+2 && bishopsColor != 3) // [HGM] all Bishops (Ferz!) same color + || gameInfo.variant == VariantXiangqi && + (NrPieces == 3 && (NrWQ==1 && NrWB==0 && NrBB<2 || NrBQ==1 && NrBB==0 && NrWB<2) || + NrPieces == 4 && NrWQ==1 && NrBQ==1 && NrWB==0 && NrBB==0)) { /* KBK, KNK, KK of KBKB with like Bishops */ /* always flag draws, for judging claims */