vitogit / pgn-tactics-generator

Generate chess puzzles / tactics from a pgn file
MIT License
111 stars 28 forks source link

invalid result? #5

Closed abjunk07 closed 3 years ago

abjunk07 commented 4 years ago

[Event "0728 03099"] [Site "?"] [Date "????.??.??"] [Round "?"] [White "solver"] [Black "?"] [Result "*"][SetUp "1"] [FEN "3r3k/6pp/3Q4/q7/8/4P2P/6P1/5RK1 b KQkq - 0 1"]

1...Rxd6 2.Rf8# *

several issues here:

  1. invalid tag [Result "*"][SetUp "1"]
  2. invalid result, must be 1-0
  3. what kind of puzzle is it? While blunder? Does it mean that the 1st move is always a wrong one? In the referred https://github.com/xinyangz/chess-tactics-pgn/ I see these kinds of 'puzzles' along with the right ones, when whoever does the 1st move wins. The guy claims that his puzzles are generated by your program, so how do I distinguish which are which?
vitogit commented 4 years ago

Hi thanks for writing about this issues.

The generated tactics pgn is designed to be imported into the ichess android program (https://play.google.com/store/apps/details?id=com.pereira.ichess&hl=en) or to be imported into lichess analytics. So it does not have in consideration tags, result or flags. The only things that matters is the basic initial position and that the first move is always a blunder so the other side will "win" the puzzle. Why it's like this? Because I use it to import into those programs and didn't think the tags or flags were relevant, but now that you bring up the issue I think it make sense.

I will keep this and your other issue open to fix it when I have time (currently I'm not actively developing this tool) or if some contributor wants to create a PR to fix them.

Thanks

karol-brejna-i commented 3 years ago

I must admit, for me, it's a bit strange to start the game with the blunder (the tactics files I used to have were all started with the move of the winning side). On the other hand, I noticed, it's quite a common approach. You can find this kind of puzzle on chess.com, for example...

@vitogit Maybe we should allow the user to decide if he wants to include the first move (blunder) into the results -- with a command-line switch, or sth.

vitogit commented 3 years ago

Totally ok with a new flag called includeBlunderMove with a default true value and if you want you can just set it to false

vitogit commented 3 years ago

I will close this issue and openend a new one to clarify the idea @karol-brejna-i https://github.com/vitogit/pgn-tactics-generator/issues/16