Algorithm for Finding Tactic Puzzles from Chess Games

Sort:
JakimPL

Hi all!

I recently wrote an article about retrieving puzzles out of your games using Stockfish (and some other tools). Now, here's the fun part: you can play such puzzles right away!

The algorithm is described quite detailed, as well as what conditions a good puzzle needs to met. Shortly: only one correct answer per each move, assuming the best opponent's response. The algorithm scans PGN files for situations that can be extracted with such properties. A more detailed description can be found in the article itself.

After scanning your PGN games you can play it on your own, in a form of a puzzle. The puzzle player interface might not be the most aesthetically pleasing at the moment, but it gets the job done. 

Tactic player
The tactic player is ugly at this moment but does its job.

If you're eager to give it a try, head over to the GitHub repository. You'll find installation guides for both Windows and Linux users. (Unfortunately, I can't provide a guide for Mac OS as I don't use it.)

To download a PGN file from your games, go to Play > Archive, select all games and click the download button:

chess.com games archive
Downloading PGN files is easy.

To make use of this tool, you'll need:

  • Python 3.10
  • Stockfish
  • pgn-extract

All the necessary links and instructions are available in the README on the GitHub repository.

I'm gladly open to your feedback! Feel free to share your thoughts and experiences. If you happen to come across interesting puzzles generated using this method, you can even export them as a PGN file (use the Copy PGN button in the tactic player) and post it here!

Happy puzzling!

JakimPL

I've created a site when you can play all puzzles captured by the algorithm:

https://chess.jakim.it/tactic_player.html

https://chess.jakim.it/tactic_player.html
https://chess.jakim.it/tactic_player.html

Enjoy!