Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: chess program problem

Author: Peter Fendrich

Date: 16:23:49 01/19/99

Go up one level in this thread


On January 19, 1999 at 18:55:19, Pat Butler wrote:

>
>
>The following is the basic structure of my program.But i get some stupid moves.
>I think i have something wrong in Quiesce.Any advice would be appreciated.
>
>int alphabeta(alpha,beta)
>{     if (deep enough)     return Quiesce(alpha,beta);
>      generate,sort moves;
>      for (each move m)
>     {    make move m;
>          Eval= -alphabeta(-beta,-alpha);
>          if  (Eval>=beta)   return beta;
>          if(Eval>alpha)   {alpha=Eval;  record move m;}
>          unmake move m;
>      }
>     return alpha,move m;
>}//end
>
>
>int  Quiesce(alpha,beta)
>{    Eval=evaluation;
>     if  (deep enough)   return Eval;
>     if   (Eval>alpha)   alpha=Eval;         ??????????
>     for  (each move m)
>     {    make move m;
>          Eval= -Quiesce(-beta,-alpha)
>          if  (Eval>=beta)     return beta;
>            if(Eval>alpha)   {alpha=Eval;  record move m;}
>          unmake move m;
>      }
>     return alpha,m;
>}//end

It doesn't make sense to first store evaluation in Eval (in Quisce) and later on
overwrite that value with Eval = -Quiecse(....). You should store the evaluation
in another variable. In the Quiesce you should have the option to not capture at
all (Supposing that you only look at capture moves) and stand pat. One shouldn't
be be *forced* to capture anything. In the end you should compare the evaluation
with what the search gave and if the the evaluation score is better than the
search score you should clear the recorded move m and return evaluation.

After Eval = evaluation it is possible to cutoff directly:
if (Eval >= beta) return beta;

Now I have to go to bed. No more chess hacking for me... :-)
//Peter

>
>
>
>
>The line  ???????      I suspect most but it could be something else.
>pat butler.





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.