A small, readable UCI chess engine in Rust, to build your own on top of.
Anglerfry is what Anglerfish was before it learned to hunt.
It speaks the protocol properly and plays badly on purpose: the interesting part is the shape — a stdin loop that keeps answering while a search thread thinks — not the moves it picks.
cargo build --release
./target/release/anglerfryIt then reads UCI commands on stdin; type uci to start. Set RUST_LOG=debug for a trace on
stderr.
Add target/release/anglerfry as a UCI engine in any chess GUI (Arena, Cute Chess, BanksiaGUI,
En Croissant). It needs no arguments and no working directory.
The Strategy option chooses how moves are picked:
random— a uniformly random legal move (the default).two-ply— a shallow negamax over material.
- Write
src/strategy/yours.rswithpub fn pick(board: &Board, limits: &Limits) -> Option<Move>, returning oncelimits.spent(nodes)says so and callingreportat least once before it does. - In
src/strategy/mod.rs: declare the module, add a variant toStrategy, and extendALL,nameandpick.
The option line and the GUI's combo box follow from ALL.
MIT — see LICENSE.