Expand description
§polyglot-book-rs
A Rust library for reading and using Polyglot opening book format for chess engines.
This library provides functionality to:
- Load Polyglot opening book files (.bin format)
- Query moves from positions using FEN strings
- Query moves from positions using custom Board implementations
- Access move weights and statistics
§Quick Start
use polyglot_book_rs::PolyglotBook;
// Load a book file
let book = PolyglotBook::load("book.bin").expect("Failed to load book");
// Query by FEN string
let starting_position = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
if let Some(entry) = book.get_best_move_from_fen(starting_position) {
println!("Best move: {} (weight: {})", entry.move_string, entry.weight);
}Re-exports§
pub use book::PolyglotBook;pub use types::PolyglotEntry;pub use types::PolyglotMove;pub use types::BoardPosition;pub use hash::polyglot_hash_from_fen;