Crate cozy_chess[−][src]
Expand description
cozy-chess
Rust Chess and Chess960 move generation library
cozy-chess
is a Chess and Chess960 move generation library written in Rust.
It is largely inspired by Jordan Bray’s neat chess
move generation library. Compared to chess
, it provides a more ergonomic but less featureful
interface. It also uses a significantly lower (currently zero) amount of unsafe
, which has
contributed to numerous unsoundness bugs in chess
. This was the primary reason for its
creation. Basic perft testing seems to indicate similar performance to chess
.
See the Board
struct to get started.
Macros
Structs
A chessboard.
A board builder to manipulate arbitrary boards.
Castling rights.
A chess move.
A compact structure representing multiple moves for a piece on the board. Iterate it to unpack its moves.
Iterator for PieceMoves
.
Enums
An error while building a board.
An error that may occur while handling a Board
.
A side to move.
An error while parsing a Color
.
A file on a chessboard
An error while parsing a File
.
The current state of the game.
An error while parsing a Move
.
A chess piece.
An error while parsing a Piece
.
A rank on a chessboard.
An error while parsing a Rank
.
A square on a chessboard.
An error while parsing a Square
.
Functions
Get all squares between two squares, if reachable via a ray.
Get the moves for a bishop on some square.
Get the rays for a bishop on some square.
Get the king moves for a king on some square.
Get the knight moves for a knight on some square.
Get a ray on the board that passes through both squares, if it exists.
Get the pawn attacks for a pawn on some square.
Get the pawn forward moves/non-captures for a pawn of some color on some square.
Get the moves for a rook on some square.
Get the rays for a rook on some square.