Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Repetitions: is this code correct?

Author: José Carlos

Date: 05:34:05 07/12/02

Go up one level in this thread


On July 12, 2002 at 08:09:43, Vladimir Medvedev wrote:

>>        SearchRepetition[ pos.GetHash() % MAXSIZE ] ++;
>>        int eval = - AlphaBeta( pos, -beta, -alpha );
>>        SearchRepetition[ pos.GetHash() % MAXSIZE ] --;
>
>Of course, CountSearchRepetitions[] instead of SearchRepetition[] :))

  You'll need a very big MAXSIZE to avoid 'pos.GetHash() % MAXSIZE' colisions,
so I think you're wasting memory. It's more usual to save the hash key in the
position struct, so your position stack has all the hash keys of the visited
positions. Then, you just go back until the next capture or pawn move and count
ocurrences of the hash key.
  As for the return value, you don't want to return alpha or beta unless you do
'fail hard'. You can simply return DRAW_SCORE (note that it might be nonzero if
you have a contempt factor).

  José C.



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.