Crate shakmaty_syzygy[−][src]
Expand description
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
variant
: Enables support for Antichess and Atomic chess.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
DTZ50′′ with rounding. Based on the distance to zeroing of the half-move clock.
File extension and magic header bytes of Syzygy tables.
A collection of tables.
Enums
Metric stored in a table: WDL or DTZ.
Error when probing a table.
Error when probing tablebase.
WDL50. 5-valued evaluation of a position in the context of the 50-move drawing rule.
Traits
A chess variant with Syzygy support.