brianch / offline-chess-puzzles

Tool to view and solve puzzles from the lichess puzzle database
MIT License
115 stars 16 forks source link

Thank you , Can you make this software import our own pgn files to train like "guess the next move " to the tactics. #24

Open Chess888 opened 3 months ago

Chess888 commented 3 months ago

Thank you , Can you make this software import our own pgn files to train like "guess the next move " of the tactics.

brianch commented 3 months ago

That's interesting, I would like to have that for my games as well.

The most obvious problem is that it's very computational intensive to generate puzzles from a game, so it would take a long time to generate the puzzles file if it were to allow normal PGNs that don't already include evals.

Another issue is that the "learn from your mistakes" feature in lichess includes mistakes for which there are multiple possible better moves, and the puzzle database includes strictly only moments for which there's a single right move (except for checkmates).

I think I could port the lichess code that generates puzzles (there's already a fork that people can use here: https://github.com/kraktus/lichess-puzzler/tree/WC, although the generated file is in a format a bit different than the one of the lichess puzzle database) and adjust things, but I would need to take a deeper look, check how the tagging is done there for example, and also double check the license (if it's AGPL like the rest of lichess, it would need to be a separate project, since it's incompatible with the MIT license I use).

I could also take a look at other projects that have the same goal, but after a quick search, I didn't find any that is still being maintained and anyway, would be nice to have more or less the same generator as lichess.

Edit: In this comment I assumed you meant tactics from our games, if you really meant a "guess the move" feature (I imagine for GM games) that's a bit out of scope, I think. I don't see much connection to puzzles, since in most positions there's very often many possible moves.

brianch commented 2 months ago

Small update on this:

I forked the repo I mentioned, and made a small tweak so that the generated csv can be read with offline-chess-puzzles, it's here: https://github.com/brianch/lichess-puzzler/

So it's not convenient yet, but at least it's now possible to generate puzzles with that python script (it takes a long time though), copy the generated csv, renaming it to pretend it's the lichess db, and play the puzzles.

I'll try to integrate tagging later, currently it's not running the tagger code so there's no theme tags. But due to an arm injury I haven't been able to work much at the computer, so it may take a while.