chess icon indicating copy to clipboard operation
chess copied to clipboard

PGN export with moves in SAN

Open jezek opened this issue 2 years ago • 0 comments

This PR brings the ability to get a SAN (Standard Algebraic Notation) for a move and to export a PGN (Portable Game Notation) for a game with moves in SAN.

A Position.SAN(...) method is added to the position package and EncodeSAN(...) function to the pgn package. Tests were added too.

Note: In the pgn package, there is a Encode(...) function, which returns a PGN but with moves in PCN. I could just fix it to encode in SAN, but I didn't want to break the API, so I created the EncodeSAN(...) function. But if you want, I can change the commits, and make it so there is only one Encode witm moves in SAN.

Note 2: This should fix issue #9

jezek avatar Dec 02 '23 00:12 jezek