Computer Chess Club Archives


Search

Terms

Messages

Subject: hashtable

Author: Jeff GAZET

Date: 02:54:52 05/11/04


Good morning,

i have some questions about the move to add into the hashtable (see code).
When doing a null move, i don't know which move to insert ?
At the end of the search() function, the "bestmove" can be null. So in
TTableInsert(), if the move is NULL, we should return immediatly ?

And another question: the score added to the hashtable depends on the side to
move, so we should use 2 transpositions tables ? or returning +-score ?

Thanks.

search(...)
	{
	bestmove=NULL;
	...
	if(it's all right for a null move)
		{
		do_nullmove();

		if(depth-R<1) {eval=-quiesce(-beta,-beta+1);}
		else {eval=-search(depth-R-1,-beta,-beta+1,false);}

		undo_nullmove();

		if(eval>=beta)
			{
			// what should be bestmove here ? as bestmove is NULL actually
			TTableInsert(depth, eval, hashfBETA,bestmove);
			return eval;
			}
		}
	...
	for(each move)
		{
		domove(themove);
		eval=-alphabeta(depth-1,-beta,-alpha,true);
		undomove();
		if(eval>alpha)
			{
			bestmove=themove;
			if(eval>=beta)
				{
				// bestmove!=NULL here
				TTableInsert(depth, eval, hashfBETA,bestmove);
				return eval;
				}

			alpha=eval;
			}
		}

	// bestmove can be NULL here or can be the last "bestmove" found in for(each
move)
	TTableInsert(depth, alpha, (alpha<=orig_alpha)?hashfALPHA:hashfEXACT,bestmove);

	return alpha;
	}



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.