A Rust library to probe Syzygy endgame tablebases, based on shakmaty.
Syzygy tables allow optimal play under the 50-move rule. Tables are available for positions with up to 6 (and experimentally 7) pieces.
```rust use shakmaty::Chess; use shakmaty::fen::Fen; use shakmaty_syzygy::{Tablebase, Wdl, Dtz, Syzygy};
let mut tables = Tablebase::new(); tables.add_directory("tables/regular")?;
let pos: Chess = "8/8/8/8/B7/N7/K2k4/8 b - - 0 1"
.parse::
let wdl = tables.probewdl(&pos)?; asserteq!(wdl, Wdl::Loss);
let dtz = tables.probedtz(&pos)?; asserteq!(dtz, Dtz(-59)); ```
Tablebase::best_move()
.u16
to usize
.Wdl
and Dtz
.Dtz(0).add_plies()
.Tablebases
to Tablebase
.TableType
in Syzygy
trait.Wdl::from(dtz)
with Wdl::from_dtz_after_zeroing(dtz)
.isize
conversions of Dtz
and Wdl
.serde-1
feature.Dtz.add_plies()
.Thanks to Ronald de Man for his Syzygy tablebases. The probing code is closely based on his implementation for Stockfish.
shakmaty-syzygy is licensed under the GPL-3.0 (or any later version at your option). See the COPYING file for the full license text.