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 2018. 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 --color _,; , .--. _,-'.-; \`-, <) o `._ ,-' ,'`_7 <_ `-\ _ _,' _.' <_`".| `\ ` _.> <_ ; \ _> `" ; `` Little Wing v0.5.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 e2e4 +---+---+---+---+---+---+---+---+ | 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 dep 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 4856 1. ... d5 2. exd5 Qxd5 3. Nc3 Qd4 5 -20 2 7520 1. ... d6 2. Nc3 Nf6 3. Nf3 Nc6 5 -3 3 11132 1. ... e5 2. Qh5 d6 3. d3 Nc6 5 1 3 12703 1. ... Nc6 2. Nc3 Nf6 3. Nf3 d5 6 -21 3 13728 1. ... Nc6 2. Nc3 Nf6 3. Nf3 d5 4. d3 7 -7 8 41121 1. ... Nc6 2. Nf3 Nf6 3. e5 Ng4 4. d4 d5 8 -30 12 60887 1. ... Nc6 2. Nf3 Nf6 3. Nc3 e6 4. d4 d5 5. e5 9 -25 29 162011 1. ... Nc6 2. d4 d5 3. e5 e6 4. Nc3 Bb4 5. Nf3 Nge7 9 -15 40 226461 1. ... e5 2. Nc3 Nf6 3. Bc4 Nc6 4. Nge2 d6 5. d3 Bg4 10 -10 66 392169 1. ... e5 2. Nc3 Nc6 3. Nf3 Nf6 4. d4 exd4 5. Nxd4 d5 6. f3 11 -10 130 783585 1. ... e5 2. Ne2 Nf6 3. Nbc3 Nc6 4. d4 exd4 5. Nxd4 d5 6. Nxc6 bxc6 12 -23 363 2254362 1. ... e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 5. Nc3 d5 6. exd5 Nxd5 7. Bc4 13 -13 690 4457080 1. ... e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 5. Nc3 d5 6. exd5 Nxd5 7. Bc4 < move e7e5 +---+---+---+---+---+---+---+---+ | 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