Computer Chess Club Archives


Search

Terms

Messages

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

Author: Mikael Bäckman

Date: 18:13:25 09/21/03

Go up one level in this thread


On September 21, 2003 at 18:21:11, Dieter Buerssner wrote:

>On September 21, 2003 at 09:15:06, Mikael Bäckman wrote:
>
>Did you test exactly this code?

No, not the exact code. I guess I should have mentioned that the code won't
compile. I didn't want to paste hundreds of lines of search functions, so I
shortened it. The idea was to show only the core of the search, the ifs and
returnvalues being more important than other code (=the junk which was removed)
within the functions, like hash probes and stores.


>>int evaluate(wtm)
>>{
>>	return wtm ? matscore : -matscore;
>>}
>>
>>int qSearch(int wtm, int alpha, int beta)
>>{
>>	score = evaluate(wtm);
>>	if (score > alpha) {
>>		if (score >= beta) return score;
>>		alpha = score;
>>	}
>>
>>	pLast = genAllCapMoves(wtm, pFirst);
>
>Is your move generator (here in qsearch, and also further down in AlphaBeta a
>legal move generator? It seems so (or you have a very severe bug), because you
>don't check for the side to move to be in check.

I check that in makeMove(). First, I make the move, then before returning from
makeMove() I check if the side to move is in check, and if so, I undo the move.
Not the most efficient way perhaps, but it works. :)


>
>>	nLegal = 0;
>
>nlegal is not declared here. Did you forget it while posting, or is it a global
>var? If it is a global var, this cannot work. You will reset nlegal of the
>caller of this function.


nLegal and all the others variables are local. The variable declarations was
'junk'. :)



>
>Regards,
>Dieter


/Mikael



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.