fsmosca / chess-artist

A python script that can annotate chess games in pgn file with static evaluation or search score of an engine, can annotate an epd file with acd, acs, bm, and ce opcodes, can test engine with epd test suite and can generate chess puzzles.
GNU General Public License v3.0
69 stars 18 forks source link

puzzle maker best moves same as provided move #87

Open GavPierce opened 1 year ago

GavPierce commented 1 year ago

Hi, really want to use this issue for a change to reach out since I had some questions on how your puzzle maker works. Really love your work. Going over the pgn of a game and comparing it to the best moves provided by the puzzle maker, it seems it provides moves that are no difference in evaluation and sometimes the same move that was made! Am I missing something?

GavPierce commented 1 year ago

@fsmosca

fsmosca commented 1 year ago

The algorithm is simple and is found in https://github.com/fsmosca/chess-artist/blob/56f7732dfbdb5ca3190ecff9d8e5340bf3a7b5b4/chess_artist.py#L2439

Generate chess position puzzle or test positions from a given pgn file.

Analyze position in the game from pgn file, record its pvmove and score
for the early part of analysis and final bestmove and bestscore after
the search. If pvmove and bestmove are not the same and score of
bestmove is higher than score at pvmove then save this as a test
position.