All Projects → niklasf → shakmaty-syzygy

niklasf / shakmaty-syzygy

Licence: GPL-3.0 license
A Rust library to probe Syzygy endgame tablebases

Programming Languages

rust
11053 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to shakmaty-syzygy

lila-tablebase
Tablebase server
Stars: ✭ 51 (+264.29%)
Mutual labels:  chess, syzygy
elephantfish
elephantfish: 一个只有124行的中国象棋引擎
Stars: ✭ 129 (+821.43%)
Mutual labels:  chess
stockfish.js
The strong open source chess engine Stockfish compiled to JavaScript and WebAssembly using Emscripten
Stars: ✭ 140 (+900%)
Mutual labels:  chess
pogchamps
Next/React + Symfony project covering the Pogchamps chess.com tournaments
Stars: ✭ 27 (+92.86%)
Mutual labels:  chess
Chess.jl
Julia chess programming library.
Stars: ✭ 91 (+550%)
Mutual labels:  chess
uci
A thin wrapper on a uci chess engine
Stars: ✭ 33 (+135.71%)
Mutual labels:  chess
cm-pgn
Parse and create PGNs (Portable Game Notation for chess games)
Stars: ✭ 16 (+14.29%)
Mutual labels:  chess
Batch-First
A JIT compiled chess engine which traverses the search tree in batches in a best-first manner, allowing for neural network batching, asynchronous GPU use, and vectorized CPU computations.
Stars: ✭ 27 (+92.86%)
Mutual labels:  chess
FabChess
UCI compliant chess engine written in Rust
Stars: ✭ 27 (+92.86%)
Mutual labels:  chess
isepic-chess
♞ JavaScript chess utility library.
Stars: ✭ 16 (+14.29%)
Mutual labels:  chess
underwater-chess
Chess, written in React, driven by a Stockfish-powered API
Stars: ✭ 20 (+42.86%)
Mutual labels:  chess
chess
An R package to read, write, create and explore chess games
Stars: ✭ 60 (+328.57%)
Mutual labels:  chess
ChineseChessOnline
一款canvas版中国象棋游戏,支持高清图像/canvas响应式设计/ 实时对战/棋谱功能/在线聊天。A Canvas version of the Chinese chess game, supporting high-definition images / Canvas responsive design / real-time combat / chess spectrum function / online chat
Stars: ✭ 25 (+78.57%)
Mutual labels:  chess
chess graph
A program that will produce a graphical sunburst chart of chess openings from the PGN that is provided to it
Stars: ✭ 35 (+150%)
Mutual labels:  chess
syzygy-tables.info
User interface and public API for probing Syzygy endgame tablebases
Stars: ✭ 49 (+250%)
Mutual labels:  chess
chess
The game of Chess
Stars: ✭ 25 (+78.57%)
Mutual labels:  chess
ConvChess
Convolutional Neural Networks learns to play chess moves
Stars: ✭ 14 (+0%)
Mutual labels:  chess
OpenChess
A cross-platform chess game.
Stars: ✭ 18 (+28.57%)
Mutual labels:  chess
rustic
Rustic is a chess engine. It is written from scratch, in the Rust programming language.
Stars: ✭ 68 (+385.71%)
Mutual labels:  chess
Checkmate
A human vs human chess game build on basic JAVA.
Stars: ✭ 15 (+7.14%)
Mutual labels:  chess

shakmaty-syzygy

A Rust library to probe Syzygy endgame tablebases, based on shakmaty.

Build Status crates.io docs.rs

Syzygy tables allow optimal play under the 50-move rule. Tables are available for positions with up to 7 pieces.

Example: Usage

use shakmaty::{CastlingMode, Chess, fen::Fen};
use shakmaty_syzygy::{Tablebase, MaybeRounded, 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>()?
    .into_position(CastlingMode::Standard)?;

let wdl = tables.probe_wdl_after_zeroing(&pos)?;
assert_eq!(wdl, Wdl::Loss);

let dtz = tables.probe_dtz(&pos)?;
assert!(matches!(dtz, MaybeRounded::Rounded(Dtz(-59))));

Example: Command line tool

A command line tool similar to Fathom:

$ cargo run --example fathom -- --path tables/chess -- "3qk3/8/8/8/8/8/8/4K3 w - - 0 1"
[Event "KvKQ"]
[Site ""]
[Date "????.??.??"]
[Round "-"]
[White "Syzygy"]
[Black "Syzygy"]
[Result "0-1"]
[FEN "3qk3/8/8/8/8/8/8/4K3 w - - 0 1"]
[Annotator "shakmaty-syzygy"]
[DTZ "-16 or -17"]

{ KvKQ with DTZ -16 or -17 } 1. Ke2 Kd7 2. Kd1 Ke6+ 3. Kc1 Qd3 4. Kb2 Qd2+ 5. Ka1 Kd5 6. Kb1 Kc4 7. Ka1 Kb3 8. Kb1 Qd1# { Checkmate } 0-1

Documentation

Read the documentation

Acknowledgement

Thanks to Ronald de Man for his Syzygy tablebases. The probing code is closely based on his implementation for Stockfish.

License

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].