rust chess
- highly compact bitboard representations
- zobrist hashing
- magic attack tables
- move generation & validation
- outcome evaluation (checkmate, stalemate, repetition, insufficient material)
- fen parsing
- immutable
- hella docs
- really really really fast (relatively)
i only support standard chess. it is unlikely i will support other variants.
probably check out shakmaty if you want more features
Caution
this is library is still at version 0.0.X
it is very likely that there will be breaking api changes until version 0.1.0
if you use this library, make sure you pin the version in cargo.toml
cargo add ruchessor in your cargo.toml
[dependencies]
ruchess = "0.0.4"use ruchess::game::Game;
use ruchess::square;
// Play 1.e4 from the standard starting position.
let game = Game::new();
let after_e4 = game.mve(square::E2, square::E4).unwrap();
assert!(after_e4.position().board().is_occupied(square::E4));see: docs for more details
see: examples or ruchess tui for example applications
- arrayvec to allocate generated moves on stack
- benchmarks
- will move to mutable api if benchmarks are very bad (update: working on performance)
- parsing
- fen
- pgn
- san
- uci
- real uci support
- finalise public api
simple and benchmarking using perft to get an estimation of performance
results in benchmark_results/
code in examples/perft.rs
benchmarks were ran on m1 macbook pro
we generate roughly 212 Mn/s
for reference, shakmaty generates roughly 223 Mn/s
we are currently about 5% slower.