Author: Robert Hyatt
Date: 08:56:54 05/11/04
Go up one level in this thread
On May 11, 2004 at 05:54:52, Jeff GAZET wrote:
>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 ?
Slow down and think about this for a minute.
You want the hash table to provide _exactly_ the same information that the
search from this position provided the _first time_ around.
There is no "best move" to store. You didn't even play a move. Insert a zero
or whatever you use to say "no best move for this position".
>
>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 ?
are you using negamax? If so +=good for side to move _always_ no matter which
side is to move...
>
>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 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.