From 6a5089a4fa20889fe9292d2187cf676fe2338303 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 5 Jul 2010 09:51:53 +0200 Subject: [PATCH] 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. --- backend.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) 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 */ -- 1.7.0.4