Author: José Carlos
Date: 06:13:53 06/01/02
Go up one level in this thread
On May 31, 2002 at 18:50:18, Omid David wrote:
>I forgot to change "negascout" to "AlphaBeta" in 7th line for better
>illustration. Here is the correction:
1: int AspWin(int estimate, int delta, int depth)
2: {
3: int alpha = estimate - delta;
4: int beta = estimate + delta;
5: int best;
6:
7: best = AlphaBeta(alpha, beta, depth);
8:
9: /* re-search */
10: if(best <= alpha)
11: best = AlphaBeta(-10000, beta, depth);
12: else if(best >= beta)
13: best = AlphaBeta(alpha, 10000, depth);
14:
15: /* is there any better way to handle this very rare case? */
16: if(best >= beta || best <= alpha)
17: best = AlphaBeta(-10000, 10000, depth);
18:
19: return best;
20: }
I numbered the lines for clarity. I think it should be:
11: {alpha = -10000; best = AlphaBeta(-10000, beta, depth);}
13: {beta = 10000; best = AlphaBeta(alpha, 10000, depth);}
If you don't update alpha and beta when researching, it can happen that you
fail low for [alpha,beta], then you research with [-inf,beta] and return best
with -inf < best < alpha which is a true score and there's no need to research.
Same for fail high.
Other than this, you're code looks correct.
José C.
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.