Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Was: AlphaBeta has a bug

Author: Robert Hyatt

Date: 18:29:37 08/31/99

Go up one level in this thread


On August 31, 1999 at 16:19:55, Daniel Clausen wrote:

>Hi
>
>I don't have question/comment to the original question but to an answer
>Mr. Hyatt posted. He said that the typical q-search looks like this:
>
>
>int Quiesce(alpha,beta) {
>  val=Evaluate();
>  if (val > beta) return(val);
>* alpha=val;
>  foreach move in(move_list) {
>     MakeMove();
>     val=-Quiesce(-beta,-alpha);
>     if (val > alpha) {
>       if (val > beta) return(val);
>       alpha=val;
>     }
>  }
>  return(alpha);
>}
>
>
>My question: Why initialize alpha to val in the marked line above?
>If I do that with my chess program it visits more q-nodes.
>
>I use "if(val>alpha) alpha = val;". Did I miss something?
>
>cu,
> -sargon


It looks like either (a) I screwed up or (b) the code got mangled...  it
should look like this:

int Quiesce(int alpha, int beta) {
  int val=Evaluate();
  if (val > alpha) {
    if (val >= beta) return(beta);
    alpha=val;
  }

... rest of code ...

}

Note the braces around the first if...  I never set alpha=val unless val
is > alpha...  as you point out...



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.