Module poirebot::game::pieces[][src]

Modules

bishop
king
knight
pawn
queen
rook
sliding

Enums

Color

A chess piece set (white or black).

Pieces

A chess piece.

Constants

ANTI_DIAGONAL

The anti-diagonal, from a8 to h1

ANTI_DIAGONALS

The 15 diagonals parallel to the anti diagonal. Starts from the bottom to the top, with the main diagonal in the middle:

DIAGONALS

The 15 diagonals parallel to the main diagonal. Starts from the bottom to the top, with the main diagonal in the middle:

FILES

All the files.

FILE_A

The A file.

FILE_B

The B file

FILE_C

The C file

FILE_D

The D file

FILE_E

The E file

FILE_F

The F file

FILE_G

The G file

FILE_H

The H file

MAIN_DIAGONAL

The main diagonal, from a1 to h8

RANKS

All the ranks.

RANK_1

The 1st rank

RANK_2

The 2nd rank

RANK_3

The 3rd rank

RANK_4

The 4th rank

RANK_5

The 4th rank

RANK_6

The 4th rank

RANK_7

The 4th rank

RANK_8

The 4th rank

Functions

get_anti_diagonal

Get the antidiagonal containing the given tile (file and rank, 0-indexed).

get_castling_rook_move

When the king moves, find whether it was a castling action. If it is a castling move, return the corresponding Move for the rook.

get_main_diagonal

Get the main-diagonal containing the given tile (file and rank, 0-indexed).

is_pawn_two_step

Whether the move was a pawn “two-step” (when they move by 2 from their original position). This function assumes the piece is already determined to be a pawn.