Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Is it optional to detect check in qsearch?

Author: Uri Blass

Date: 06:31:44 05/04/05

Go up one level in this thread


On May 04, 2005 at 07:27:02, Kevin K wrote:

>int Quies(int alpha, int beta)
>
>{
>
>    if (InCheck())  // check detection part
>        return AlphaBeta(1, alpha, beta);
>    val = Evaluate();
>    if (val >= beta)
>        return beta;
>    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 code came from http://www.seanet.com/~brucemo/topics/quiescent.htm
>He said that "This version will find mates in quiescence if they involve
>captures.  Which version to use is a matter of taste and testing."
>I thought check detection is compulsory not optional.
>How does it work without check detection in qsearch?

What do you mean by check detection.

Do you mean checking if the last move allow the opponent to capture the king or
Do you mean checking if the last move threat the opponent king?

InCheck() can be understood in both ways and it may cause confusion.

Bruce means to check if the last move threat the opponent king.
checking if the last move allow the opponent to capture the king is not needed
in a legal move generator.

If your move generator generates illegal moves then you need more code than the
code in bruce page and you need to add to bruce's code something like

if last_move_is_illegal()
 val=-Mate;
else




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.