lichess.org
Donate

Am I missing something in the puzzles database, or are solutions just not included?

I'm looking at the puzzles database CSV, and for example here's the first row:
00008,r6k/pp2r2p/4Rp1Q/3p4/8/1N1P2R1/PqP2bPP/7K b - - 0 24,f2g3 e6e7 b2b1 b3c1 b1c1 h6c1,1830,76,90,228,crushing hangingPiece long middlegame,lichess.org/787zsVup/black#48

The FEN is r6k/pp2r2p/4Rp1Q/3p4/8/1N1P2R1/PqP2bPP/7K b - - 0 24 (lichess.org/study/m0TuKIBE). Be3 is the solution, as Stockfish will suggest if you go to that puzzle, but the moves listed start with f2g3, or Bxg3, in SAN. That's a blunder that totally loses the game though. I think those are the moves from the real game, not the right moves.

So I'm trying to create a CLI chess tactics tool, but I guess I'm at a loss as to how I should use the puzzles. I could run stockfish on the position and just use its suggested move as the best move, so for 1 move at a time that's not bad. Then the problem is how far to continue the tactic, but maybe I could just continue until stockfish says that there are two roughly equal moves.

Guess I'm just hoping someone will tell me I'm missing something here, because it would make my life a lot easier if the puzzles had solutions.
The first move is the move played, right before the puzzle starts.

Here black played Bxg3?? And the puzzle is solved with white to move

This is explained here: database.lichess.org/#puzzles
"The position to present to the player is after applying the first move to that FEN.
The second move is the beginning of the solution."
So, the starting position is indeed the FEN you provided. The puzzle has as following:
Bxg3 is played (which is indeed a blunder) and the player needs to find the only winning move which is Rxe7
And so goes on with the solution.

So basically, the first move is the mistake/blunder on which the puzzle is based and the solution starts with the second move.

EDIT: Apparently I was a bit too slow :D but hope it's clear now :))
A problem I faced with the puzzles is that it appears only one solution is ever privided in the csv file, even when the puzzle has multiple solutions (which occurs in checkmate puzzles only). My quick fix was to simply not serve puzzles that had the tag "mate", but I would have liked to find a better solution.
EDIT: #7 is right

@lego00 You could use the mateIn1 tag instead of the mate tag. As is on the database page ,

"An exception is made for mates in one: there can be several. Any move that checkmates should win the puzzle."

so if you don't need to remove all mate puzzles at least. If you want to have mate in 1, you would probably need to implement some check for that in whatever you are doing
@TBest The mates in one are not always on the first move though. So it could totally apply to a mateIn2 puzzle as well. But I suppose checking for checkmates in a given position is not so hard, I was personally using node with the chess.js library, it's probably quite easy to check if a given move is mate there.

This topic has been archived and can no longer be replied to.