From: H.G.Muller Date: Mon, 6 Feb 2017 22:02:30 +0000 (+0100) Subject: Allow only moves that beat alpha to become best move X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=b27e913c5348fbd84459c1e2b924f5209b276400;p=crazywa.git Allow only moves that beat alpha to become best move In case of a fail low we don't want to sort a garbage move in front for the next iteration. --- diff --git a/dropper.c b/dropper.c index 2d8f108..912f5f0 100644 --- a/dropper.c +++ b/dropper.c @@ -1290,10 +1290,10 @@ printf("%d:%d:%d %2d. %08x %c%d%c%d %6d %6d %6d\n",ply,depth,iterDepth,curMove,m if(f.depth < resultDepth) resultDepth = f.depth; if(score > bestScore) { - bestScore = score; bestNr = curMove; + bestScore = score; if(score > alpha) { int *tail; - alpha = score; + alpha = score; bestNr = curMove; history[moveStack[curMove] & 0xFFFF] += iterDepth*iterDepth; if(score >= beta) { // beta cutoff if(curMove >= m.nonCapts && moveStack[curMove] != killers[ply][1])