From 1f2d6ce95da83e3770f1f00972bca3f1ff818013 Mon Sep 17 00:00:00 2001 From: Richard Delorme Date: Sun, 25 Jun 2017 23:03:26 +0200 Subject: [PATCH] Update search.d --- src/search.d | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/search.d b/src/search.d index 85e7e5f..f1ed295 100644 --- a/src/search.d +++ b/src/search.d @@ -255,7 +255,7 @@ final class Search { e = board.inCheck; if (moves.isFirst(m)) s = -αβ(-β, -α, d + e - 1); else { - s = -αβ(-α - 1, -α, d - 1); + s = -αβ(-α - 1, -α, d + e - 1); if (α < s && s < β) s = -αβ(-β, -α, d + e - 1); } restore(m); @@ -287,7 +287,11 @@ final class Search { Move m = rootMoves[i]; update(m); e = board.inCheck; - s = -αβ(-β, -α, d + e - 1); + if (i == 0) s = -αβ(-β, -α, d + e - 1); + else { + s = -αβ(-α - 1, -α, d + e - 1); + if (α < s && s < β) s = -αβ(-β, -α, d + e - 1); + } restore(m); if (stop) break; if (s > bs && (bs = s) > α) {