Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 2.04 KB

README.md

File metadata and controls

44 lines (34 loc) · 2.04 KB

RustChess

Python-chess inspired chess library in Rust

Features

  • abstract structures for representing basic chess entities, namely the board, pieces, and moves,
  • making moves and undoing moves,
  • keeping track of the previously made moves,
  • printing the current position in a terminal, in human-friendly form,
  • understanding all the chess rules, including lesser-known but a part of the official FIDE laws of chess, such as the en-passant, fifty-move rule or the threefold and fivefold repetition,
  • generating legal and pseudo-legal moves,
  • creating a move from the UCI as well as SAN format,
  • setting the board position using FEN format,
  • extracting the board position to the FEN format,
  • resetting the board to the starting position,
  • the internal representation of a chess game using a tree-like or graph structure, allowing for handling alternative sequences of moves deviating from the main line.
  • fast parsing of PGN files,
  • communication with UCI compatible chess engines,
  • querying online Syzygy tablebase API,
  • detection of absolute pins,
  • detection of checkmates,
  • detection of draws by insufficient material,
  • detection of checks and attacks,
  • counting number of moves without pushing the pawns and without captures for the fifty-move rule,
  • detecting threefold and fivefold repetitions.

Example

image

UCI communication

image

Performance

PGN parsing speed

image

Median times of parsing PGN files (single-core) compared to python-chess using PyPy and regular interpreter

Game Analysis speed

image

Median time of benchmark code compared to python-chess using PyPy and regular interpreter