Crate littlewing[][src]

Little Wing is a chess engine rated at 2050+ ELO, compatible with both UCI and XBoard protocols, with a nice CLI, and a documented library.

Example

use littlewing::game::Game;
use littlewing::fen::FEN;
use littlewing::clock::Clock;
use littlewing::search::Search;
use littlewing::piece_move_generator::PieceMoveGenerator;
use littlewing::piece_move_notation::PieceMoveNotation;

// Byrne vs Fischer (1956)
let fen = "r3r1k1/pp3pbp/1Bp1b1p1/8/2BP4/Q1n2N2/P4PPP/3R1K1R b - - 0 18";

let mut game = Game::from_fen(fen);

game.clock = Clock::new(1, 5000); // Search 1 move in 5 seconds

match game.search(1..15) { // Search from depth 1 to 15
    Some(m) => {
        assert_eq!(game.move_to_san(m), "Bxc4");

        game.make_move(m);
        game.history.push(m); // Keep track of the moves played

        println!("Engine played {}", m.to_can());
    },
    None => {
        println!("Engine could not find a move to play");
    }
}

Modules

bitboard

Bitboard type

clock

Clock controls

color

Color type

eval

Evaluation algorithms

fen

Forsyth–Edwards Notation support

game

Game engine

piece

Piece type

piece_move_generator

Piece move generator

piece_move_notation

Piece move notation

protocols

Communication protocols

search

Search algorithms

square

Square type

Functions

version

Return Little Wing's version