notnil / chess

chess package for go
MIT License
508 stars 126 forks source link

Scanner: Add option flag to expand variations #127

Open mikeb26 opened 1 year ago

mikeb26 commented 1 year ago

Note this PR depends on prior PR: https://github.com/notnil/chess/pull/125

This series of commits adds an optional ability to expand variations when utilizing Scanner to iterate over a .pgn file. This is done by introducing an optional ScannerOpts where consumers of Scanner can specify different scanning behavior, beginning with an ExpandVariations option. When ExpandVariations==true, rather than create a single Game instance when scanning over a single game in a .pgn file, Scanner will instead create 1 Game instance per variation.