Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Repetition Detection

Author: Dennis Breuker

Date: 02:12:46 12/02/04

Go up one level in this thread


>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



This page took 0.08 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.