From 803bb6e0165570619f8adebdc5e3c7d7c455fca9 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 22 Dec 2012 20:40:26 +0100 Subject: [PATCH] Implement insufficient mating material for Knightmate KBK is draw with Royal Knight. With exo-pieces also KNK and KFK. --- backend.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) 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]; -- 1.7.0.4