Little Wing =========== [![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) A bitboard chess engine written in Rust. A work in progress since December 2014. [![asciicast](https://asciinema.org/a/146112.png)](https://asciinema.org/a/146112) - Board representation - Bitboard with LLVM CTPOP and CTTZ - FEN support - Zobrist hashing - Staged moves generation - MVV/LVA and SEE moves ordering with insertion sort - Search - Principal variation search - Quiescence search - Transpositions table - Null move pruning - Internal iterative deepening - Futility pruning - Late move reduction - Killer heuristic - Evaluation - Piece square table evaluation - Mobility evaluation - Static exchange evaluation - Interface - CLI with play and debug commands - XBoard and UCI communication protocol - Public API with documented library Tested on GNU/Linux 32 and 64 bits, should run anywhere. Usage ----- First you need to 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 $ LITTLEWING_VERSION=$(git describe) cargo build --release $ sudo cp target/release/littlewing /usr/local/bin Little Wing is compatible with XBoard and UCI communication protocols, in addition it has its own text-based user interface: $ littlewing --color --debug Little Wing v0.4.0 > move e2e4 > show board +---+---+---+---+---+---+---+---+ | r | n | b | q | k | b | n | r | +---+---+---+---+---+---+---+---+ | p | p | p | p | p | p | p | p | +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ | | | | | P | | | | +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ | P | P | P | P | | P | P | P | +---+---+---+---+---+---+---+---+ | R | N | B | Q | K | B | N | R | +---+---+---+---+---+---+---+---+ > show think > time 1 10 > play # using 0 threads # FEN rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 # allocating 10000 ms to move # starting search at depth 1 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 1 860 1. ... Nc6 2. Nc3 Nf6 3. Nf3 4 -31 1 2435 1. ... d5 2. exd5 Qxd5 3. Nc3 5 -32 2 4559 1. ... d5 2. exd5 Qxd5 3. Nc3 Qd4 5 -21 2 7708 1. ... d6 2. Qe2 Nf6 3. Nc3 Nc6 5 -3 3 11522 1. ... e5 2. Qh5 d6 3. d3 Nc6 5 1 4 13090 1. ... Nc6 2. Nc3 Nf6 3. Nf3 d5 6 -21 4 14191 1. ... Nc6 2. Nc3 Nf6 3. Nf3 d5 4. d3 7 -7 10 42921 1. ... Nc6 2. Nf3 Nf6 3. e5 Ng4 4. d4 d5 8 -30 15 68987 1. ... Nc6 2. Nf3 Nf6 3. Nc3 e6 4. d4 d5 5. e5 9 -18 42 203216 1. ... Nc6 2. d4 d5 3. exd5 Qxd5 4. Nf3 Qe4+ 5. Be3 e5 10 -43 68 337369 1. ... Nc6 2. d4 e6 3. Nc3 d5 4. Nf3 dxe4 5. Nxe4 Nf6 6. Bg5 10 -38 113 570619 1. ... d5 2. exd5 Qxd5 3. Nc3 Qe6+ 4. Nge2 Nf6 5. d4 Nc6 6. Bf4 10 -21 136 689628 1. ... e5 2. Nc3 Nf6 3. Nf3 Nc6 4. Bb5 Qe7 5. d3 d6 11 -8 244 1231372 1. ... e5 2. c4 Bd6 3. Nf3 Ne7 4. Nc3 Nbc6 5. d4 O-O 6. c5 exd4 12 -22 488 2552398 1. ... e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 d5 6. exd5 Nxd5 13 -13 859 4716253 1. ... e5 2. Nf3 Nf6 3. Nc3 Nc6 4. d4 exd4 5. Nxd4 d5 6. exd5 Nxd5 7. Bc4 Qe7+ # score: -22 # time: 9951 ms # nodes: 5571362 (5.60e5 nps) # tt size: 524288 (8 MB) # - lower: 382039 (72.87 %) # - upper: 54669 (10.43 %) # - exact: 170 (0.03 %) # tt inserts: 941233 # tt lookups: 3650051 # - miss: 1472020 (40.33 %) # - hits: 469768 (12.87 %) # - collisions: 1708263 (46.80 %) < move e7e5 +---+---+---+---+---+---+---+---+ | r | n | b | q | k | b | n | r | +---+---+---+---+---+---+---+---+ | p | p | p | p | | p | p | p | +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ | | | | | p | | | | +---+---+---+---+---+---+---+---+ | | | | | P | | | | +---+---+---+---+---+---+---+---+ | | | | | | | | | +---+---+---+---+---+---+---+---+ | P | P | P | P | | P | P | P | +---+---+---+---+---+---+---+---+ | R | N | B | Q | K | B | N | R | +---+---+---+---+---+---+---+---+ > help Commands: quit Exit this program help Display this screen hint Search the best move play [] Search and play [] move[s] undo Undo the last move move Play on the board load Set the board to show Show hide Hide time