w-chess 0.1.1

A chess library for Rust.
Documentation
  • Coverage
  • 45.45%
    10 out of 22 items documented10 out of 11 items with examples
  • Size
  • Source code size: 91.50 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.94 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • KorieDrakeChaney

w-chess

Created for my next project of turning PGN into video. I wanted to create the chess library, so that I have full control. Of course, anyone can use this or peek through. ⭐ Star if you like ⭐

Features

  • Move generation
  • Move history
  • Checkmate detection
  • Castling
  • En passant
  • Pawn promotion
  • Draw detection
  • FEN parsing
  • PGN parsing

Usage

use w_chess::Chessboard;

fn main() {
    let board = Chessboard::new();

    // Move a piece
    board.move_to("e4");

    // Get ASCII representation of the board
    println!("{}", board.ascii());

    // Get FEN representation of the board
    println!("{}", board.fen());

    // Get all possible moves
    let moves = board.legal_moves();

    // Get history
    let history = board.history();
}