bhlangonijr / chesslib

chess library for legal move generation, FEN/PGN parsing and more
Apache License 2.0
229 stars 80 forks source link

Nested variations handling #92

Open WolandPL opened 2 years ago

WolandPL commented 2 years ago

Hi! Does the chesslib handle multiple variations nested in the PGN in a single game (i.e. a game with analysis)?

andrebrunner commented 2 years ago

I think there is a problem with the pgn-parser. For example

  1. d4 f5 2. Nc3 Nf6 3. Bg5 d5 4. f3 c5 5. dxc5 (5. e4 5. .. Nc6 6. Bb5 a6 (6. .. h6 7. Bxf6 gxf6 8. exd5) 7. Bxc6+ bxc6 8. e5) (5. e3 e6) 5. .. d4 6. Nb1 (6. Na4 Qa5+ 7. c3 Bd7 8. b3 dxc3) 6. .. e5 * the second (5. e3 e6) variation is not correctly integrated in the variations array ...