I try to verify my repetition detection.
This is what says the FIDE :
The code in Vice (and mine also) is as follow :The game is a draw if a position occurs (at least) three times during the game. (Intervening moves do not matter.) It must be claimed by the player with the turn to move. The claim is made:
(a) If the position is about to appear for the third time, the player making the claim first writes their move on their scoresheet and notifies the arbiter that they intend to make this move.
or
(b) If the position has just appeared for the third time, the player with the move can claim the draw.
Positions are considered the same if
(1) the same player has the move,
(2) pieces of the same kind and color occupy the same squares, and
(3) the possible moves of all the pieces are the same.
Code: Select all
static int IsRepetition(const S_BOARD *pos) {
for(int index = pos->hisPly - pos->fiftyMove; index < pos->hisPly-1; ++index) {
if(pos->posKey == pos->history[index].posKey) {
return TRUE;
}
}
return FALSE;
}
but I don't see it.
Another thing, why not increment index by 4, since we must have the same player to play.
Thanks
Philippe