ruchess
rust chess
features
- 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
quickstart
[!CAUTION] this is library is still at version
0.0.Xit is very likely that there will be breaking api changes until version
0.1.0if you use this library, make sure you pin the version in cargo.toml
or in your cargo.toml
[]
= "0.0.4"
use Game;
use square;
// Play 1.e4 from the standard starting position.
let game = new;
let after_e4 = game.mve.unwrap;
assert!;
see: docs for more details
see: examples or ruchess tui for example applications
dependencies
just lazy_static
i could probably get rid of it with some refactoring but i am lazy
roadmap
- benchmarks
- will move to mutable api if benchmarks are very bad
- parsing
- fen
- pgn
- san
- uci
- real uci support
- finalise public api
benchmarks
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
at depth=4 and depth=5, we are at 7ms and 177ms respectively.
for reference, shakmaty and jordanbray/chess are at 0.8 - 1ms for depth=4 and 18.6 - 24.1ms for depth=5. we are currently an order of magnitude slower.
it is worth noting that the shakmaty and jordanbray benchmarks weren't run on my machine but still (sort of) indicative.