Closed dlbbld closed 4 years ago
Can you please check this? It looks like it ignores the initial position, so miscounting by one.
For another example, I take the game between Fischer and Petrosian from 1971 in Wikipedia (https://en.wikipedia.org/wiki/Threefold_repetition#Fischer_versus_Petrosian,_1971).
In this game, there is a threefold repetition per Wikipedia after 30.Qe2, 32.Qe2, then 34.Qe2. When the game is continued starting after 30. Qe2 was played, after 34. Qe2 no draw claim is offered, so the threefold repetition is not detected.
When I play through this game from beginning with a friend (ok, I don't have always time to do so, but tried), then after 34.Qe2 the draw can be claimed. The threefold repetition works fine in normal games; this only happens when continuing from a position.
When the game is continued one move earlier, starting after 29... Kh7, after 34.Qe2 the threefold repetition can be claimed. But this is wrong, as the initial position has all the necessary information (en passant information and castling rights) to determine later threefold repetition from this point onwards, so there is no need to start earlier. It looks as it ignores the initial position for the threefold count, so when starting one move earlier, only then the example works.
The first examples are, however, easier, this is provided as a second example.
Via next scalachess update: https://github.com/ornicar/scalachess/pull/204
White gets draw claim from initial position after below moves, which is correct:
White gets no draw claim from custom position after below moves, which is incorrect: