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.
}
}
+ 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++;