Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Is this a correct fail-soft?

Author: Dieter Buerssner

Date: 11:52:39 09/22/03

Go up one level in this thread


On September 21, 2003 at 09:15:06, Mikael Bäckman wrote:

>int qSearch(int wtm, int alpha, int beta)
>{
>	score = evaluate(wtm);
        bestscore = score;
>	if (score > alpha) {
>		if (score >= beta) return score;
>		alpha = score;
>	}
>
>	pLast = genAllCapMoves(wtm, pFirst);
>	nLegal = 0;
>
>	while (pMove = nextMove(pFirst, pLast)) {
>		if (makeMove(wtm, pMove)) {
>			nLegal++;
>			score = -qSearch(wtm^1, -beta, -alpha);
>			unmakeMove(pMove);
                        if (score > bestscore)
                          bestscore = score;
>			if (score > alpha) {
>				if (score >= beta) return score;
>				alpha = score;
>			}
>		}
>	}

        return bestscore;
        /* instead of
>	if (!nLegal) return score;
>	return alpha;

        No need to check nLegal, unless you want to do something
        specific in case of check */
>}

I think, I found the problem. You will typically return alpha here in cases,
where all subsearches and the eval are smaller alpha. This basically makes the
whole search fail hard.

Regards,
Dieter



This page took 0.01 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.