Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Detecting three-fold repetition?

Author: Peter McKenzie

Date: 13:10:21 07/17/00

Go up one level in this thread


On July 17, 2000 at 13:40:28, Tom Kerrigan wrote:

>I've had a number of requests to implement 3-fold repetition detection in TSCP.
>It's also clear that TSCP would do better in tournaments (although that isn't
>the goal...) if it could detect these draws.
>
>So the question is, is there an easy way to do the detection?
>
>In my "strong" program, I just compare hash keys. But TSCP doesn't keep hash
>keys and I have no intention for it to do so. So is there another way to do it?
>
>Thanks in advance.
>
>-Tom

You can do a simple version of repetition detection that catches short
repetitions by just looking at the last few moves.

For example, consider the repetition (from start position) 1.Ng1-f3 Nb8-c6
2.Nf3-g1 Nc6-b8 3.Ng1-f3

Things to note about this sequence of moves: 4 reversible moves in a row (no
castling, captures or pawn moves), your 50move code should keep track of this.
The first move in the sequence could have been a capture.

To square of last move = to square of move at ply-4.
From square of last = to square of move at ply-2

To square of move at ply-1 = from square of move at ply-3


You can extend this logic to handle longer sequences without too much pain.  I
guess if you generalise it totally you end up with something like what John
Stanback posted.

cheers,
Peter



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.