Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: The Old way to detect 3fold repetition (help needed)

Author: Bruce Moreland

Date: 07:10:52 03/26/01

Go up one level in this thread


On March 26, 2001 at 08:05:27, Masciulli Gianluigi wrote:

>When Tom Kerrigham decised to implemet 3fold repetition on tscp,
>somebody (I dont remember who) posted an interesting method
>(I think is from an old gnuchess) witout hash and simpler.
>Anybody remember it?
>Maybe its the method is the actually implemeted on tscp.
>can anyone help me to find it on the CCC archive (I dont remember
>who and when posted it!)
>
>TIA
>
>gianluigi
>
>(PS Golem actually use the hash to detect 3fold repetition but i need
>the metodh for a friend)

Here are a couple of other ways to do it, in case you are interested:

1) In your main hash table you write the key and set a flag when you enter a
position.  In your search, when you do a lookup on this hash table, check the
flag, and if it's set, return a draw score.  There are drawbacks to this.
Chiefly, you end up overwriting every hash node upon entry.  You may also have
problems if your hash scheme doesn't allow for repetitive probes -- it's hard to
figure out what to do if you find an entry for an open position, but the keys
don't match.  Another disadvantage is that it's a challenge to get this to work
if you have multiple threads and a shared hash table.

2) Make a table with a few hundred elements, each of which is simply a hash key.
 When you enter a node, probe.  If you find the current key, return a draw.
Otherwise stick the current key into the table.  When you are done, zero the
entry.  The disadvantage to this method is that it requires a second table, but
the table is small.  Also, you can do a simple rehash scheme (just look at the
next element) without changing how you do your real table.  Another advantage is
that it is extremely simple to write and debug.  Finally, if you have multiple
processors going, you just put the table in the per-thread context.

bruce




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.