Expand description
A library for compressing chess moves and positions. The code is straight ports of Java and Scala originals made by the Lichess project, with some tweaks to the API.
Note that when decompressing, you need to know how many plies you want to decompress. This is because a given move sequence is not guaranteed to fill the last byte exactly. In this case, any trailing bits in the input would cause havoc if we didn’t know how many elements to decompress.
Enums§
- Error
- Errors that can occur when decompressing or compressing moves.
Functions§
- compress
- Compress a sequence of moves from the starting position.
- compress_
from_ position - Compress a sequence of moves from a given position.
- compress_
position - Compress a position.
- decompress
- Decompress a given number of moves from the starting position.
- decompress_
from_ position - Decompress a given number of moves from a given position.
- decompress_
position - Decompress a position.
- read_
move - Low-level function that reads a single move from a
BitReader. - write_
move - Low-level function writing a single compressed move to a
BitWriter.