Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How can I escape from check in Qsearch?

Author: Daniel Mehrmannn

Date: 14:08:58 05/03/05

Go up one level in this thread


On May 03, 2005 at 13:51:35, Kevin K wrote:

>    quiesce(int alpha, int beta) {
>        int score = eval();
>        if (score >= beta) return score;
>        for (each capturing move m) {
>            make move m;
>            score = -quiesce(-beta,-alpha);
>            unmake move m;
>            if (score >= alpha) {
>                alpha = score;
>                if (score >= beta) break;
>            }
>        }
>        return score;
>    }
>I found this from http://www.ics.uci.edu/~eppstein/180a/990204.html
>But there is no code which takes care of escaping from check.
>Where do I have to put code which handles escaping from check in Qsearch?

light version:

    quiesce(int alpha, int beta) {

        SideInCheck = in_check();
        if (SideInCheck) {
            genAllMoves();
        } else {
            /* StandPat CutOff */
            int score = eval();
            if (score >= beta) return score;
            genCaptures();
        }

        for (each capturing move m) {
            make move m;
            score = -quiesce(-beta,-alpha);
            unmake move m;
            if (score >= alpha) {
                alpha = score;
                if (score >= beta) break;
                                   ^^^^^^ ?????
                                   must be return beta;

            }
        }
        return score;
    }

hope thats help
Daniel




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.