From: H.G.Muller Date: Tue, 7 Feb 2017 21:33:53 +0000 (+0100) Subject: Implement initiative bonus X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=913f0723e75b75665f6fb840e51ef3987260bcc1;p=crazywa.git Implement initiative bonus An initiative bonus is awarded to the side to move, based on seige of the opponent King and own pieces in hand. A second attempt to stand pat on the score including this bonus is then made. --- diff --git a/dropper.c b/dropper.c index 7b65c34..9081a17 100644 --- a/dropper.c +++ b/dropper.c @@ -1222,6 +1222,18 @@ if(hashMove && board[hashMove>>8&255] == 0) {char s[100];sprintf(s,"bad hash mov } } + if(depth <= 0) { + int bonus = (m.safety + 3*m.hole)*(10 + m.safety + m.hole + promoGain[stm+30] /*- 0*promoGain[COLOR-stm+30]*/) + 15*m.cBonus; + bonus += (m.escape < 2 ? 200 - m.escape*100 : 0); + if(bonus > 900) bonus = 900; // S4 + bonus += bonus >> 1; + int newEval = curEval + bonus; + if(newEval > alpha) { + if(newEval >= beta) { ff->depth = 1; moveSP = oldSP; return newEval; } // stand-pat cutoff + alpha = startScore = newEval; maxDepth = 0; // we will not fail low, so no extra iterations + } + } + do { // IID loop int curMove, highDepth; iterDepth++;