2 releases

0.1.1 Mar 23, 2024
0.1.0 Mar 23, 2024

#22 in #chess-board

MIT license

92KB
2K SLoC

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();
}

No runtime deps