Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: QSearch question

Author: Andrew Williams

Date: 16:02:25 02/22/03

Go up one level in this thread


On February 22, 2003 at 17:53:00, Patrik wrote:

>int Quies(int alpha, int beta)
>{
>    val = Evaluate();
>    if (val >= beta)
>        return beta; 	<=== I don't understand this line.
>    if (val > alpha)
>        alpha = val;
>    GenerateGoodCaptures();
>    while (CapturesLeft()) {
>        MakeNextCapture();
>        val = -Quies(-beta, -alpha);
>        UnmakeMove();
>        if (val >= beta)
>            return beta;
>        if (val > alpha)
>            alpha = val;
>    }
>    return alpha;
>}
>
>This is QSearch from Mr. Moreland's site.
>Can I return when val >= beta if I generate all capture moves
>instead of generating only good capture moves?

What difference does it make if you do this *before* generating them? :-)

The line simply means that if you don't do anything, the score is already better
than the best score you can hope to get in this position (beta). We call val the
"stand-pat" score. It reflects the fact that we don't *have* to capture; we can
stop capturing and just make some "neutral" move. Since it is your move, you are
just assuming that there will be an available move that does not make your
position *worse*. That's almost always a sensible assumption.

Andrew




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.