Crate polyglot_book_rs

Crate polyglot_book_rs 

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

Modules§

book
Polyglot opening book loading and querying functionality.
fen
FEN (Forsyth-Edwards Notation) parsing utilities.
hash
Polyglot hash computation for chess positions.
types
Core types and traits for the Polyglot library.