Crate bunnies

Crate bunnies 

Source

Modules§

attacks
This module contains functions to calculate attack bitboards for different pieces. The direct exports are the recommended way to calculate attack masks. However, the precomputed, manual, and magic submodules may also be used.
masks
This module contains bitboard masks that may be useful.
pgn
This module provides functionality for parsing and rendering PGN (Portable Game Notation).
utilities
This module contains various utility functions, structs, and types that are useful (internally and externally), but are not needed in the top-level API.

Structs§

Board
A struct representing the positions of all pieces on the board, for both colors, and the zobrist hash of the position.
Move
Represents a move in the game. Internally, it is stored as a 16-bit unsigned integer.
Position
A struct containing all the information needed to represent a position in a chess game.
PositionContext
A struct containing metadata about the current and past states of the game.

Enums§

Color
Represents a side of the board.
ColoredPiece
Represents a colored (white or black) piece on the board.
FenParseError
An error that occurs when parsing a FEN string.
GameResult
Represents the different ways a game can end.
MoveFlag
Enum representing the different types of moves that can be made in a game of chess. Used in the Move struct.
Piece
Represents a piece on the board. Includes Null, Pawn, Knight, Bishop, Rook, Queen, and King. The values are 0, 1, 2, 3, 4, 5, and 6 respectively.
Square
Represents a square on the chess board.

Constants§

INITIAL_FEN
The FEN string representing the starting position of a standard chess game.

Traits§

BitboardUtils

Functions§

get_piece_zobrist_hash
Gets the Zobrist hash for a piece on a square.

Type Aliases§

Bitboard
A type alias for a bitboard. A bitboard is a 64-bit unsigned integer that represents an aspect of board state. Each bit represents a square on the board, with the most significant bit representing A8 and the least significant bit representing H1.