The Stack Overflow podcast is back! Listen to an interview with our new CEO.
16

You quote an extract from the FIDE Laws of Chess which includes the simple instruction "see Article 9.2" yet you don't bother to "see Article 9.2" where your question is answered - 9.2.1 The game is drawn, upon a correct claim by a player having the move, when the same position for at least the third time (not necessarily by a repetition of moves): 9....


12

Draw by mutual agreement is not allowed before move 30. But a draw by threefold repetition can be claimed at any point if it occurs.


12

Threefold-repetition is about a position (not moves) occurring three times. Those positions do not have to be reached by the same moves. Also (as this also seems to be confused sometimes) it is completely irrelevant when this happens, e.g. you can have the same positions after moves 10, 42 and 63 and it would still be a draw. You should check whether the ...


10

The FIDE Laws of Chess provide some guidance. Rule 6.2.1 says you must move the piece before hitting the clock: During the game each player, having made his move on the chessboard, shall stop his own clock and start his opponent’s clock (that is to say, he shall press his clock). This “completes” the move. According to rule 8.1.2, you must move the ...


8

This is a better question than it seems at first glance. Intuitively it seems possible to claim a draw, since the position appears to have occurred three times. However, according to a strict reading of the rules, the position after 4...Ng8 has appeared only for the second time. The relevant clauses are 9.2: [...] Positions are considered the same if ...


8

No, you cannot claim. In fact your right to claim ends as soon as you touch a piece. Here's what the rules say, emphasis in bold mine: 9.2.1 The game is drawn, upon a correct claim by a player having the move, when the same position for at least the third time (not necessarily by a repetition of moves): 9.2.1.1 is about to appear, if he ...


8

According to the FIDE Laws of Chess: 9.2.2 Positions are considered the same if and only if the same player has the move, pieces of the same kind and colour occupy the same squares and the possible moves of all the pieces of both players are the same. Thus positions are not the same if: 9.2.2.1 at the start of the sequence a pawn could have been ...


7

Hi thanks for the question! Yes this is what FIDE are saying. If you are about to play the 50.0th move of the sequence, or to cause a position to occur for the third time, then you need to claim before you move. I think this is because after you have moved the piece, your opponent is allowed to respond, without waiting for you to punch the clock. If you ...


6

There was a three-times repetition. Note that only the position needs to be repeated, it is not necessary that the moves leading to the position are the same. The position occurred first after move 58, second after move 60 and third at the end of the game.


6

If you have a collection of games in PGN format, you could probably search for threefold repetitions using the Chess Query Language. In particular, you might look in the "Matching positions: the position list" portion of the manual at the provided link; the :sequence keyword would likely be instrumental to a CQL solution. For an example of using CQL to do ...


5

Although @user1583209 is on the right track. His approach would only work for a chess GUI but too slow for a chess engine. Modern engines only check for the last few moves, they won't go all the way back to the initial position because that'd be an almost waste of time. You have complicated your code too much. In reality, checking for repetition is very ...


5

There is no such thing as "3 move repetition". To claim a draw, the position must be repeated three times (although it does not have to be in a row). In your example, the position with a Black queen and b4 and a White king on b2 has only occurred twice so far. You can claim a draw by repetition of position the next time that you can cause that position to ...


5

I think that your question is an excellent one. @Remillion, @itub and @SmallChess have answered it already. I believe that I mostly—perhaps wholly—agree with their answers, so now I would like to add an answer on a different level. The FIDE has not shown that it fully grasps the kind of question you are asking. You and I get it. To some extent, ...


5

This is dealt with explicitly in article 9.2.2 - 9.2.2 Positions are considered the same if and only if the same player has the move, pieces of the same kind and colour occupy the same squares and the possible moves of all the pieces of both players are the same. Thus positions are not the same if: 9.2.2.1 at the start of the sequence a pawn could ...


5

This seems to be an omission in law 9.2.2.2: 9.2.2.2 a king had castling rights with a rook that has not been moved, but forfeited these after moving. The castling rights are lost only after the king or rook is moved. It should read "The castling rights are lost only after the king or rook is moved, or the rook is captured." Indeed, that is how I hope an ...


4

You cannot claim a draw by repetition because the position hasn't occurred three times. As you noted, only that particular arrangement of pieces has occurred three times, but a position is more than just an arrangement of pieces (it involves whose turn it is).


4

You have identified the correct rule governing these situations. 9.2.2 is the relevant clause that applies; 9.2.2.1 and 9.2.2.2 are just clarifications of this rule. So to answer your queries: 1) Your interpretation of castling rights is correct. Each player has two castling rights which are irrespective of the current board position. The right to castle ...


4

Could this theoretically go on forever in a game with time increment? No, because the arbiter would step in and declare the game drawn after the fifth repetition of the position. According to the FIDE Laws of Chess - 9.6 If one or both of the following occur(s) then the game is drawn: 9.6.1 the same position has appeared, as in 9.2.2 at least five ...


3

While comparing FEN strings may be common practice, I don't think it is correct according a close reading of the rule. I would say that the rule is already completely specified by its first sentence (emphasis added): Positions are considered the same if and only if the same player has the move, pieces of the same kind and colour occupy the same squares ...


3

No. You shouldn't count null-move in repetitions because: Null-move is fake Null-move artificially creates a repetition when there is none Your implementation is correct, but you might want to exclude null-move. Let's take a look at Stockfish: https://github.com/official-stockfish/Stockfish/blob/master/src/position.cpp bool Position::is_draw(int ply) ...


3

There is a really famous one between Petrosian and Fischer. Fischer had a really tough position and was delighted with Tigran's last move and claimed a threefold repetition.


3

For a draw in chess any one of the following rules should satisfy : stalemate threefold repetition of a position (with the same player to move) if there has been no capture or a pawn being moved in the last fifty moves if checkmate is impossible or if the players agree to a draw. The threefold repetition rule (also known as repetition of position) states ...


3

I would say 50 moves (possibly 49). Three-fold repetition requires the game to return same position 3 times. This obviously can't happen if there are any captures or pawn moves, so therefore as long as the 3-fold repetition is possible so is the 50-move rule - which provides a hard upper limit.


3

Here is an improvement over my original suggestion. The game finishes after White's 128th move, repeating the position after their 62nd and 87th moves, so the distance is 66 moves. The source for this game was Mark Crowther's The Week in Chess. [FEN ""] [Event "Int ch-Central SRB Op A"] [Site "Paracin SRB"] [Date "2016.07.12"] [Round "7.38"] [White "Tisma,I"...


2

The position after 47.… g4, 49.… Kc8 could have been repeated with 51.… Kc8. Because you have to claim threefold repetition before you make the move 51.…Kc8, producing the same position on the board, this would have been a sensible point for a popup dialog.


2

Upon review, it looks to me as though you had found a bug in the program. No threefold repetition even seems possible on the next move, much less during the moves already made.


2

I would look at the source code for TSCP which implements zobrist keys. Basically you assign a unique number to each position and store the numbers in a list. Then check if the same number is in the list three times. you generate the unique number based on the position of the pieces, en passant square, side to move. here i have copied and pasted the TSCP ...


2

Maybe I don't understand your question very well. Obviously, there can be a threefold repetition with the first occurence of the repetition being 50 (or 49 so that the 50-moves rule doesn't apply) moves ago and the second occurence happening 25 moves ago. There are lots of cases when you can reduce the input to the neural network, for instance each time a ...


2

...So the first part of my question is, am I correct in my assessment of how the right to castle affects whether positions are identical?... ...other restrictions like check, obstructions, or even whether the relevant rook was captured are not considered (though the last is probably irrelevant)... Yes. Imagine we play a game from the starting position, ...


Only top voted, non community-wiki answers of a minimum length are eligible