polyglot_book_rs/
lib.rs

1//! # polyglot-book-rs
2//!
3//! A Rust library for reading and using Polyglot opening book format for chess engines.
4//!
5//! This library provides functionality to:
6//! - Load Polyglot opening book files (.bin format)
7//! - Query moves from positions using FEN strings
8//! - Query moves from positions using custom Board implementations
9//! - Access move weights and statistics
10//!
11//! ## Quick Start
12//!
13//! ```rust,no_run
14//! use polyglot_book_rs::PolyglotBook;
15//!
16//! // Load a book file
17//! let book = PolyglotBook::load("book.bin").expect("Failed to load book");
18//!
19//! // Query by FEN string
20//! let starting_position = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
21//! if let Some(entry) = book.get_best_move_from_fen(starting_position) {
22//!     println!("Best move: {} (weight: {})", entry.move_string, entry.weight);
23//! }
24//! ```
25
26pub mod book;
27pub mod hash;
28pub mod types;
29pub mod fen;
30
31pub use book::PolyglotBook;
32pub use types::{PolyglotEntry, PolyglotMove, BoardPosition};
33pub use hash::polyglot_hash_from_fen;