lichess.org
Donate

Is everything OK with the 'threefold repetition' algorithm

of course it was threefold. moves 29, 31, 33 all the same
@Cedur216 said in #2:
> of course it was threefold. moves 29, 31, 33 all the same

Yes, but it doesn't look like the _position_ was repeated 3 times, even though white made the same series of moves. And it's the position that matters, right? This does look like a problem with the algorithm.
@borninthesixties said in #3:
> Yes, but it doesn't look like the _position_ was repeated 3 times, even though white made the same series of moves. And it's the position that matters, right? This does look like a problem with the algorithm.

The position reported by #2 is the same in the three turns. Check again.
@Deadban said in #4:
> The position reported by #2 is the same in the three turns. Check again.

Ah, you are right - I see it now. Thanks.
Do what I do: punch onto the position after 29, 31 and 33. Does anything move? :)
#1
Reminder: It's not the 'moves' that matter, it's the 'position' that matters!
Dude, it's like this ...

Consider a stack of plates, or pizza boxes, whatever ...

First position in the game is either at the top or the bottom of the stack, doesn't matter ... but all subsequent positions go in the stack in the same order (actually an r-b tree is the most efficient method, but that is immaterial to our discussion)

In any case, every game position, sits in the stack ... if a new position is already present (and using the above this can be done very efficiently indeed), we increment a counter for that stack node ...

As soon as one of the counters gets to three, bingo !

It's a draw ...

This topic has been archived and can no longer be replied to.