Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: A question about quiescence search

Author: Antonio Dieguez

Date: 12:03:09 10/20/02

Go up one level in this thread


Here is a more clear formulation, imho! :)


int qsearch(int lower, int upper)
{
    // we are pessimistic: our best score is the enemy threat
    make(null-move);
    best= -captsearch(-upper, -lower);
    unmake(null-move);

    // no need to score better than the upper bound:
    if (best>=upper)
        return best;

    // improve our best score by searching moves:
    for each capture/fork/checking/tipicalqsearch move m do {
       make(m);
       value= -qsearch(-upper, -best);
       unmake(m);
       if (value>best) {
           if (value>=upper)
               return value;

           best= value;
       };
    };

    // we are bad anyway

     if (eval()<=best)
     { return best }

    // little optimization

     if (eval<upper)
     { upper=eval }

    // see if score will go low or not.

    for each aditional move m do {
       make(m);
       value= -qsearch(-upper, -best);
       unmake(m);
       if (value>best) {
           if (value>=upper)
               return value;

           best= value;
       };
    };

    return best;
}

with the same capturesearch as before.

seeyou.



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.