[−][src]Crate shakmaty_syzygy
Probe Syzygy endgame tablebases.
Syzygy tables allow optimal play under the 50-move rule. Tables are available for positions with up to 7 pieces.
Example
use shakmaty::{CastlingMode, Chess}; use shakmaty::fen::Fen; use shakmaty_syzygy::{Tablebase, Wdl, Dtz, Syzygy}; let mut tables = Tablebase::new(); tables.add_directory("tables/chess")?; let pos: Chess = "8/8/8/8/B7/N7/K2k4/8 b - - 0 1" .parse::<Fen>()? .position(CastlingMode::Standard)?; let wdl = tables.probe_wdl(&pos)?; assert_eq!(wdl, Wdl::Loss); let dtz = tables.probe_dtz(&pos)?; assert_eq!(dtz, Dtz(-59));
Errors
See SyzygyError
for possible error
conditions.
Cargo features
backtrace
: Provides abacktrace
field onProbeError::CorruptedTable
. This may be useful to identify issues with corrupted tablebase files or to debug the probing code. Currently requires nightly Rust.
Structs
Dtz | Distance to zeroing of the half-move clock. |
TableType | File extension and magic header bytes of Syzygy tables. |
Tablebase | A collection of tables. |
Enums
Metric | Metric stored in a table: WDL or DTZ. |
ProbeError | Error when probing a table. |
SyzygyError | Error when probing tablebase. |
Wdl | 5-valued evaluation of a position in the context of the 50-move drawing rule. |
Traits
Syzygy | A chess variant with Syzygy support. |