From: H.G. Muller Date: Sat, 22 Dec 2012 19:40:26 +0000 (+0100) Subject: Implement insufficient mating material for Knightmate X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=803bb6e0165570619f8adebdc5e3c7d7c455fca9;p=xboard.git Implement insufficient mating material for Knightmate KBK is draw with Royal Knight. With exo-pieces also KNK and KFK. --- diff --git a/backend.c b/backend.c index 6e24b1a..92c741c 100644 --- a/backend.c +++ b/backend.c @@ -7614,6 +7614,9 @@ MatingPotential (int pCnt[], int side, int nMine, int nHis, int stale, int bisCo || majors + (12*pCnt[BlackFerz-side] | 6*pCnt[BlackAlfil-side]) > 16; // KCKAA, KCKAX, KCKEEX, KCKEXX (XX!=HH), KCKXXX // TO DO: cases wih an unpromoted f-Pawn acting as platform for an opponent Cannon + } else if(v == VariantKnightmate) { + if(nMine == 1) return FALSE; + if(nMine == 2 && nHis == 1 && pCnt[WhiteBishop+side] + pCnt[WhiteFerz+side] + pCnt[WhiteKnight+side]) return FALSE; // KBK is only draw } else if(pCnt[WhiteKing] == 1 && pCnt[BlackKing] == 1) { // other variants with orthodox Kings int nBishops = pCnt[WhiteBishop+side] + pCnt[WhiteFerz+side];