zxul767 / pawn

A chess engine and machine learning testbed
4 stars 2 forks source link

Replace `GameReader` implementation with JSON #26

Open zxul767 opened 2 years ago

zxul767 commented 2 years ago

There is no point in creating our own format when we could use JSON to store the configuration. Parsing it could be easily done with a library like https://github.com/nlohmann/json

zxul767 commented 2 years ago

After reviewing the implementation of python-chess, I'm inclined to believe that maybe we should just use an existing persistence format (such as FEN notation or some variant that can fully capture the state of a game--including castling privileges, en-passant capture possibility, etc.)

It is important to say that our current format doesn't actually account for all possibilities. For example, in a game loaded from our format, it is impossible to tell whether a position has been repeated more than once (so as to be able to claim a draw by 3-fold repetition). One format that does support this is the Portable Game Notation