From: H.G.Muller Date: Mon, 15 May 2017 13:15:08 +0000 (+0200) Subject: Prevent pawn-drop mates in Shogi X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d8482b77dca489c145a5a208cf1d4877907b7903;p=crazywa.git Prevent pawn-drop mates in Shogi In case of a mate we now check if the previous move was a Pawn drop, and correct the score to a win if we detect one. In Crazyhouse we test for check, and correct to draw due to stalemate without one. --- diff --git a/dropper.c b/dropper.c index e421cba..37111d0 100644 --- a/dropper.c +++ b/dropper.c @@ -1429,6 +1429,12 @@ if(PATH)printf("%d:%d:%d iter end, max=%d, alpha=%d start=%d\n", ply, depth,iter } while(iterDepth < maxDepth && (ply || !TimeIsUp(1))); // IID loop + if(bestScore == -INF) { // we are mated! + if(perpLoses) { // Shogi + if(ff->fromSqr == handSlot[stm]) bestScore = INF; // mated by Pawn drop, so we win! + } else if(f.checker == CK_NONE) bestScore = 0; // stalemate in zh is draw + } + cutoff: // delayed-loss bonus bestScore += (bestScore < curEval);