Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Repetition Detection

Author: Uri Blass

Date: 02:34:01 12/02/04

Go up one level in this thread


On December 02, 2004 at 05:12:46, Dennis Breuker wrote:

>>This is what I use in TSCPGothic for repetition check:
>>
>>/* reps() returns the number of times the current position
>>   has been repeated. It compares the current value of hash
>>   to previous values. */
>>
>>int reps(void)
>>{
>>   int i;
>>   int r = 0;
>>
>>   for (i = hply - fifty; i < hply; ++i)
>>      if (hist_dat[i].hash == dynhash)
>>         ++r;
>>   return r;
>>}
>>
>>Let me know if you can optimize this even more further.
>>
>
>You could do i+=2 instead of ++i, since the repetition only occurs with
>the same side to move...
>
>Dennis

He can also start by checking
if (fifty<=3)
return 0;

Uri





This page took 0.03 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.