Module pleco::core [] [src]

Contains various components and structures supporting the creation of a chessboard. This includes SQ, BitBoard, Player, Piece, GenTypes, Rank, and File. Also holds the statically created MagicHelper, which at runtime creates various lookup tables.

Modules

bit_twiddles

Collection of useful functions oriented around modifying singular bits of integer types. You will rarely need to interact with this module directly unless you need functions involving the manipulation of bits.

bitboard

Module containing the BitBoard and associated functions / constants.

magic_helper

This module contains useful pre-computed lookup tables involving BitBoards.

masks

Masks and various other constants.

mono_traits

Traits & Dummy Types defined for various Enum types. Shouldn't be used in place of their enum representations.

piece_move

Module for the implementation and definition of a move to be played.

sq

Contains the representation of a chessboard's square.

Enums

CastleType

Types of Castling available to a player.

File

Enum for the Files of a Chessboard.

GenTypes

Types of move generating options.

Piece

All possible Pieces on a chessboard.

Player

Enum to represent the Players White & Black.

Rank

Enum for the Ranks of a Chessboard.

Constants

ALL_PIECES

Array of all possible pieces, indexed by their enum value.

ALL_PLAYERS

Array of both players, indexed by their enum value.

Statics

ALL_FILES

Array of all Filess, indexed by their enum value.

ALL_RANKS

Array of all Ranks, indexed by their enum value.

Functions

file_bb

For whatever file the bit (inner value of a SQ) is, returns the corresponding file as a u64.

file_idx_of_sq

For whatever file the bit (inner value of a SQ) is, returns the corresponding File index.

file_of_sq

For whatever file the bit (inner value of a SQ) is, returns the corresponding File.

rank_bb

For whatever rank the bit (inner value of a SQ) is, returns the corresponding rank as a u64.

rank_idx_of_sq

For whatever rank the bit (inner value of a SQ) is, returns the corresponding Rank index.

rank_of_sq

For whatever rank the bit (inner value of a SQ) is, returns the corresponding Rank.

u64_to_u8

Converts a singular bit of a u64 to it's index in the u64. If there's more than one bit in the u64, this will be done for the least significant bit.

u8_to_u64

Given a square (u8) that is valid, returns the bitboard representation of that square.