mliebelt / pgn-viewer

Simple PGN viewer with the necessary features to display chess games
GNU General Public License v3.0
159 stars 44 forks source link

pgnPuzzle not playing the whole line #522

Closed NeroDiTroia closed 4 months ago

NeroDiTroia commented 4 months ago

I was able to generate many puzzles and opening training lines, but for some reason this fails with the Scandinavian, the move 2... Qxd5 is never played.

    <div id="boardLeo1" style="width: 320px"></div>
      <script>
      var pgnLeo1 = "1. e4 d5 2. exd5 Qxd5 3. Nc3 Qa5 4. b4 Qb6 5. Nf3";
      var boardLeo1 = PGNV.pgnPuzzle('boardLeo1', {position: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1', pgn: pgnLeo1, orientation: 'white', theme: 'zeit'});
      </script>

I tried using uci notation (1. e2e4 etc) but the result is exactly the same.

mliebelt commented 4 months ago

Thank you for bringing that to my attention. As you may know, the puzzle mode is quite new, therefore we expect it to have strange effects. I will look into it, and hopefully I can find the reason for the failure. I will create a ticket HTML file for it, to show the effect, and document on this ticket what will be done.

NeroDiTroia commented 4 months ago

Thanks a lot! The puzzle mode works really well, it can handle entire games, it even takes PGN imported from lichess studies with all the comments and annotations, so I was surprised that it gets stuck on move 2.

I am very new to this so this package is a blessing, very easy to implement. When the puzzle fails I use PGNV.pgnView, but PGNV.pgnPuzzle is so much nicer.

ppeloton commented 4 months ago

Happy to hear that the puzzle mode is already attracting users. I just made a pull request that should fix the issue.

mliebelt commented 4 months ago

Released new version, should contain the fix.