Crates.io | eschac |
lib.rs | eschac |
version | 0.1.0 |
created_at | 2025-09-03 19:04:06.446157+00 |
updated_at | 2025-09-03 19:04:06.446157+00 |
description | computing chess moves |
homepage | |
repository | https://git.pnm.tf/pnm/eschac |
max_upload_size | |
id | 1823056 |
size | 175,854 |
A library for computing chess moves.
eschac implements fast legal move generation and a copy-make interface that enforces at compile time that no illegal move is played, with no runtime checks and no potential panics.
use eschac::prelude::*;
// read a position from a text record
let setup = "7k/4P1rp/5Q2/5p2/1Pp1bP2/8/r4K1P/6R1 w - -".parse::<Setup>()?;
let position = setup.validate()?;
// read a move in algebraic notation
let san = "Ke1".parse::<San>()?;
let m = san.to_move(&position)?;
// play the move (note the absence of error handling)
let position = m.make();
// generate all the legal moves on the new position
let moves = position.legal_moves();
for m in moves {
// print the UCI notation of each move
println!("{}", m.to_uci());
}
shakmaty is another Rust library for chess processing. It is written by Niklas Fiekas, whose work greatly inspired the development of eschac. For most purposes, shakmaty is probably a better option, as eschac comes short of its miriad of features.
Both libraries have the same core features:
eschac distinguishes itself with:
shakmaty will be more suitable for a lot of applications, with:
eschac is licensed under AGPL-3.0 (or any later version at your option).