bhlangonijr / chesslib

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

Numbered move lists #66

Closed ZeroOne3010 closed 3 years ago

ZeroOne3010 commented 3 years ago

This pull request adds two useful methods that can be used to output a MoveList with move numbers: toSanWithMoveNumbers() and toFanWithMoveNumbers(). An example of the output of the former would be "1. e4 e5 2. Nf3 Bc5 " and an example of the output of the latter would be "1. ♙e4 ♟e5 2. ♘f3 ♝c5 ".

Both methods have javadocs and unit tests, and I even refactored the repetitive parts so that it's pretty clean. I also took a shot at improving the javadocs of some other, related methods a bit.