Answers.Body: <p>If you have a collection of games in PGN format, you could probably search for threefold repetitions using the <a href="https://web-beta.archive.org/web/20160303173407/http://www.rbnn.com/cql/" rel="nofollow noreferrer">Chess Query Language</a>. In particular, you might look in the "Matching positions: the position list" portion of the manual at the provided link; the <code>:sequence</code> keyword would likely be instrumental to a CQL solution.</p>
  
  <p>For an example of using CQL to do this sort of thing, see my answer to <a href="https://chess.stackexchange.com/q/1717/167">an earlier question</a> about seeking out exchange sacrifices in games. The method given there uses CQL to scan games for short sequences of successive positions that have a material difference of an exchange. I imagine you'd be able to do something similar to seek out sequences of positions repeating three times.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-28T19:28:51.840Z
Answers.Text: If a player claims threefold repetition one move before the actual position has been repeated (telling the arbiter: "I will make this move and the position will be repeated 3 times"), would the final (unmade) move actually appear in the database? If not, you might miss some games if you search for positions repeated 3 times only.
Answers.UserDisplayName: user1583209
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-10T07:25:00.323Z
Answers.LastActivityDate: 2017-04-28T18:31:45.183Z
Answers.LastEditDate: 2017-04-28T18:31:45.183Z
Answers.UserDisplayName: ETD
Answers.Body: <p>There is <a href="http://www.chessgames.com/perl/chessgame?gid=1106921" rel="nofollow noreferrer">a really famous one between Petrosian and Fischer</a>. Fischer had a really tough position and was delighted with Tigran's last move and claimed a threefold repetition.</p>
  <pre><code>[Event &quot;Fischer - Petrosian Candidates Final&quot;]
  [Site &quot;Buenos Aires ARG&quot;]
  [Date &quot;1971.10.07&quot;]
  [EventDate &quot;1971.09.30&quot;]
  [Round &quot;3&quot;]
  [Result &quot;1/2-1/2&quot;]
  [White &quot;Robert James Fischer&quot;]
  [Black &quot;Tigran Vartanovich Petrosian&quot;]
  [ECO &quot;C11&quot;]
  [WhiteElo &quot;?&quot;]
  [BlackElo &quot;?&quot;]
  [PlyCount &quot;67&quot;]
  [FEN &quot;&quot;]
  
  1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 dxe4 5. Nxe4 Be7 6. Bxf6
  gxf6 7. g3 f5 8. Nc3 Bf6 9. Nge2 Nc6 10. d5 exd5 11. Nxd5 Bxb2
  12. Bg2 O-O 13. O-O Bh8 14. Nef4 Ne5 15. Qh5 Ng6 16. Rad1 c6
  17. Ne3 Qf6 18. Kh1 Bg7 19. Bh3 Ne7 20. Rd3 Be6 21. Rfd1 Bh6
  22. Rd4 Bxf4 23. Rxf4 Rad8 24. Rxd8 Rxd8 25. Bxf5 Nxf5
  26. Nxf5 Rd5 27. g4 Bxf5 28. gxf5 h6 29. h3 Kh7 30. Qe2 Qe5
  31. Qh5 Qf6 32. Qe2 Re5 33.Qd3 Rd5 34.Qe2 1/2-1/2
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2016-01-10T07:02:46.150Z
Answers.LastActivityDate: 2020-10-27T21:21:09.843Z
Answers.LastEditDate: 2020-10-27T21:21:09.843Z
Answers.UserDisplayName: Patzerook
Answers.Body: <p>There is an option in <a href="https://www.cs.kent.ac.uk/%7Edjb/pgn-extract/" rel="nofollow noreferrer">pgn-extract</a> (--repetition) that will identify PGN games in which three-fold repetition occurs, regardless of whether the game is ended by it or not. Combined with the --markmatches option a comment can be added at the point(s) where this occurred for ease of identification.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-10-27T18:27:36.937Z
Answers.LastActivityDate: 2020-10-27T18:27:36.937Z
Answers.UserDisplayName: kentdjb
Body: <p>When I go to <a href="http://www.chessgames.com/" rel="nofollow noreferrer">http://www.chessgames.com/</a>, I can search for matches that end in draws. However, I can not figure out how to filter those draws to specifically threefold repetition. How can I find these types of draws while filtering out the rest?</p>
  
Tags: <draw><threefold-repetition>
Title: How can I find games from grandmasters that end in threefold repetition?
ThreadText: # How can I find games from grandmasters that end in threefold repetition?
  
  (Asked by: username_0 on 2015-05-03)
  
  When I go to <http://www.chessgames.com/>, I can search for matches that end in draws. However, I can not figure out how to filter those draws to specifically threefold repetition. How can I find these types of draws while filtering out the rest?
  
  **Tags:** draw, threefold-repetition
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2016-01-10. Score: 6
  
  If you have a collection of games in PGN format, you could probably search for threefold repetitions using the [Chess Query Language](https://web-beta.archive.org/web/20160303173407/http://www.rbnn.com/cql/). 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 this sort of thing, see my answer to [an earlier question](https://chess.stackexchange.com/q/1717/167) about seeking out exchange sacrifices in games. The method given there uses CQL to scan games for short sequences of successive positions that have a material difference of an exchange. I imagine you'd be able to do something similar to seek out sequences of positions repeating three times.
  
  > **Comments:**
  > **username_2**: If a player claims threefold repetition one move before the actual position has been repeated (telling the arbiter: "I will make this move and the position will be repeated 3 times"), would the final (unmade) move actually appear in the database? If not, you might miss some games if you search for positions repeated 3 times only.  
  
  ---
  
  ### Answer by username_3 on 2016-01-10. Score: 4
  
  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.
  [Event "Fischer - Petrosian Candidates Final"]
  [Site "Buenos Aires ARG"]
  [Date "1971.10.07"]
  [EventDate "1971.09.30"]
  [Round "3"]
  [Result "1/2-1/2"]
  [White "Robert James Fischer"]
  [Black "Tigran Vartanovich Petrosian"]
  [ECO "C11"]
  [WhiteElo "?"]
  [BlackElo "?"]
  [PlyCount "67"]
  [FEN ""]
  
  1. e4 e6 2. d4 d5 3. Nc3 Nf6 4. Bg5 dxe4 5. Nxe4 Be7 6. Bxf6
  gxf6 7. g3 f5 8. Nc3 Bf6 9. Nge2 Nc6 10. d5 exd5 11. Nxd5 Bxb2
  12. Bg2 O-O 13. O-O Bh8 14. Nef4 Ne5 15. Qh5 Ng6 16. Rad1 c6
  17. Ne3 Qf6 18. Kh1 Bg7 19. Bh3 Ne7 20. Rd3 Be6 21. Rfd1 Bh6
  22. Rd4 Bxf4 23. Rxf4 Rad8 24. Rxd8 Rxd8 25. Bxf5 Nxf5
  26. Nxf5 Rd5 27. g4 Bxf5 28. gxf5 h6 29. h3 Kh7 30. Qe2 Qe5
  31. Qh5 Qf6 32. Qe2 Re5 33.Qd3 Rd5 34.Qe2 1/2-1/2
  
  
  ---
  
  ### Answer by username_4 on 2020-10-27. Score: 0
  
  There is an option in [pgn-extract](https://www.cs.kent.ac.uk/%7Edjb/pgn-extract/) (--repetition) that will identify PGN games in which three-fold repetition occurs, regardless of whether the game is ended by it or not. Combined with the --markmatches option a comment can be added at the point(s) where this occurred for ease of identification.
  
  
  ---
  
  