Little Wing: a chess engine written in Rust =========================================== [![Travis](https://img.shields.io/travis/vinc/littlewing/master.svg)](https://travis-ci.org/vinc/littlewing/branches) [![Crates.io](https://img.shields.io/crates/v/littlewing.svg)](https://crates.io/crates/littlewing) Little Wing is the successor of [Purple Haze](https://github.com/vinc/purplehaze). The project started in December 2014 to learn the Rust language and play with bitboards. Both experiments were conclusive and Little Wing it is still maintained in 2019. Currently evaluated at 2000+ ELO on CCRL 40/4 Rating List. [![asciicast](https://asciinema.org/a/146112.png)](https://asciinema.org/a/146112) Features -------- - Interfaces - A nice CLI with many commands - XBoard and UCI communication protocols - Public API with [documented library](https://docs.rs/littlewing) - Board representation - Bitboard with LLVM CTPOP and CTTZ - Sliding piece attacks with Hyperbola Quintessence and First Rank Attacks - Zobrist hashing with Xorshift RNG - Staged moves generation - MVV/LVA and SEE moves ordering with insertion sort - FEN support - Search - Principal variation search - Quiescence search - Transposition table - Null move pruning - Internal iterative deepening - Futility pruning - Late move reduction - Killer heuristic - Evaluation - Piece square table evaluation - Mobility evaluation - Static exchange evaluation Install ------- Binaries for GNU/Linux (x86-64), Android (ARMv7), and Windows (x86-64) are available: https://vinc.cc/binaries If you want to compile Little Wing yourself, you must first install Rust: $ curl https://sh.rustup.rs -sSf | sh Then you can install the latest stable version of the engine with Cargo: $ cargo install littlewing Or the development version by fetching the git repository: $ git clone https://github.com/vinc/littlewing.git $ cd littlewing $ export RUSTFLAGS="-C target-cpu=native" $ export LITTLEWING_VERSION="$(git describe)" $ cargo build --release $ sudo cp target/release/littlewing /usr/local/bin Usage ----- Little Wing is compatible with XBoard and UCI communication protocols, and in addition it has its own text-based user interface: $ littlewing _,; , .--. _,-'.-; \`-, <) o `._ ,-' ,'`_7 <_ `-\ _ _,' _.' <_`".| `\ ` _.> <_ ; \ _> `" ; `` Little Wing v0.7.0 \ | \ '|-. _ \ by Vincent Ollivier _/ / \ '. +---+---+---+---+---+"-"`---+--'\_> | r | n | b | q | k | b | n | r | 8 +---+---+---+---+---+---+---+---+ | p | p | p | p | p | p | p | p | 7 +---+---+---+---+---+---+---+---+ | | | | | | | | | 6 +---+---+---+---+---+---+---+---+ | | | | | | | | | 5 +---+---+---+---+---+---+---+---+ | | | | | | | | | 4 +---+---+---+---+---+---+---+---+ | | | | | | | | | 3 +---+---+---+---+---+---+---+---+ | P | P | P | P | P | P | P | P | 2 +---+---+---+---+---+---+---+---+ | R | N | B | Q | K | B | N | R | 1 +---+---+---+---+---+---+---+---+ a b c d e f g h > move e4 +---+---+---+---+---+---+---+---+ | r | n | b | q | k | b | n | r | 8 +---+---+---+---+---+---+---+---+ | p | p | p | p | p | p | p | p | 7 +---+---+---+---+---+---+---+---+ | | | | | | | | | 6 +---+---+---+---+---+---+---+---+ | | | | | | | | | 5 +---+---+---+---+---+---+---+---+ | | | | | P | | | | 4 +---+---+---+---+---+---+---+---+ | | | | | | | | | 3 +---+---+---+---+---+---+---+---+ | P | P | P | P | | P | P | P | 2 +---+---+---+---+---+---+---+---+ | R | N | B | Q | K | B | N | R | 1 +---+---+---+---+---+---+---+---+ a b c d e f g h > time 1 10 > show think > play black ply score time nodes pv 1 -46 0 1 1. ... a6 1 -45 0 3 1. ... c6 1 -22 0 4 1. ... d6 1 -20 0 5 1. ... e6 1 -1 0 14 1. ... d5 1 0 0 15 1. ... e5 1 9 0 20 1. ... Nc6 2 -47 0 53 1. ... Nc6 2. Nc3 3 9 0 278 1. ... Nc6 2. Nc3 Nf6 4 -45 0 860 1. ... Nc6 2. Nc3 Nf6 3. Nf3 4 -31 1 2437 1. ... d5 2. exd5 Qxd5 3. Nc3 5 -32 1 4647 1. ... d5 2. exd5 Qxd5 3. Nc3 Qd4 5 -20 2 7442 1. ... d6 2. Nc3 Nf6 3. Nf3 Nc6 5 0 2 11381 1. ... e5 2. Nc3 Nf6 3. Nf3 Nc6 5 1 2 12946 1. ... Nc6 2. Nc3 Nf6 3. Nf3 d5 6 -21 3 14052 1. ... Nc6 2. Nc3 Nf6 3. Nf3 d5 4. d3 7 -7 6 34813 1. ... Nc6 2. Nf3 Nf6 3. e5 Ng4 4. d4 d5 8 -29 9 53113 1. ... Nc6 2. Nf3 Nf6 3. e5 Ng4 4. d4 d6 5. h3 9 -25 27 181431 1. ... Nc6 2. d4 d5 3. e5 e6 4. Nc3 Bb4 5. Nf3 Nge7 9 -12 35 241217 1. ... e5 2. Nc3 Nf6 3. Nf3 Nc6 4. d4 exd4 5. Nxd4 d5 10 -10 50 363028 1. ... e5 2. Nc3 Nf6 3. Nf3 Nc6 4. d4 exd4 5. Nxd4 d5 6. f3 11 -7 109 815399 1. ... e5 2. Nf3 Nf6 3. Nxe5 d6 4. Nc4 Nxe4 5. d3 Nf6 6. Nc3 Nc6 12 -23 218 1686098 1. ... e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 d5 6. exd5 Nxd5 7. Bc4 13 -13 467 3791367 1. ... e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 d5 6. exd5 Nxd5 7. Bc4 < move e5 +---+---+---+---+---+---+---+---+ | r | n | b | q | k | b | n | r | 8 +---+---+---+---+---+---+---+---+ | p | p | p | p | | p | p | p | 7 +---+---+---+---+---+---+---+---+ | | | | | | | | | 6 +---+---+---+---+---+---+---+---+ | | | | | p | | | | 5 +---+---+---+---+---+---+---+---+ | | | | | P | | | | 4 +---+---+---+---+---+---+---+---+ | | | | | | | | | 3 +---+---+---+---+---+---+---+---+ | P | P | P | P | | P | P | P | 2 +---+---+---+---+---+---+---+---+ | R | N | B | Q | K | B | N | R | 1 +---+---+---+---+---+---+---+---+ a b c d e f g h > help Commands: quit Exit this program help Display this screen load [] Load game from save [] Save game to hint Search the best move play [] Search and play [] move[s] undo Undo the last move move Play on the board show Show hide Hide time