From d8482b77dca489c145a5a208cf1d4877907b7903 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 15 May 2017 15:15:08 +0200 Subject: [PATCH] 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. --- dropper.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) 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); -- 1.7.0.4