Crate chess_compression

Source
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.