Module pleco::helper::prelude[][src]

Default functions for accessing the statically computed tables.

Safety

Using any of these methods is inherently unsafe, as it is not guaranteed that they'll be initiated correctly. Consider using the Helper structure to guarantee initialization.

Documentation

These functions are documented in Helper , rather than here.

Functions

adjacent_file

Gets the adjacent files BitBoard of the file

adjacent_sq_file

Gets the adjacent files BitBoard of the square

aligned

Returns if three Squares are in the same diagonal, file, or rank.

between_bb

Get the line (diagonal / file / rank) BitBoard between two squares, not including the squares, if it exists.

bishop_moves

Generate Bishop Moves BitBoard from a bishop square and all occupied squares on the board. This function will return captures to pieces on both sides. The resulting BitBoard must be AND'd with the inverse of the intending moving player's pieces.

distance_of_sqs

Get the distance of two squares.

forward_file_bb

Returns the BitBoard of all squares in the file in front of the given one.

forward_rank_bb

Returns the BitBoard of all squares in the rank in front of the given one.

init_statics

Initializes the static structures. Guarantees to only allow being called once.

king_moves

Generate King Moves BitBoard from a source square.

knight_moves

Generate Knight Moves BitBoard from a source square.

line_bb

Get the line (diagonal / file / rank) BitBoard that two squares both exist on, if it exists.

passed_pawn_mask

Returns a BitBoard allowing for testing of the a pawn being a "passed pawn".

pawn_attacks_from

Pawn attacks BitBoard from a given square, per player. Basically, given square x, returns the BitBoard of squares a pawn on x attacks.

pawn_attacks_span

Returns the BitBoard of all squares that can be attacked by a pawn of the same color when it moves along its file, starting from the given square. Basically, if the pawn progresses along the same file for the entire game, this bitboard would contain all possible forward squares it could attack

piece_value

Returns the value of a Piece. If eg is true, it returns the end game value. Otherwise, it'll return the midgame value.

piecetype_value

Returns the value of a PieceType. If eg is true, it returns the end game value. Otherwise, it'll return the midgame value.

psq

Returns the score for a player's piece being at a particular square.

queen_moves

Generate Queen Moves BitBoard from a bishop square and all occupied squares on the board. This function will return captures to pieces on both sides. The resulting BitBoard must be AND'd with the inverse of the intending moving player's pieces.

ring_distance

Returns the ring of bits surrounding the square sq at a specified distance.

rook_moves

Generate Rook Moves BitBoard from a bishop square and all occupied squares on the board. This function will return captures to pieces on both sides. The resulting BitBoard must be AND'd with the inverse of the intending moving player's pieces.

z_castle

Returns the Zobrish hash for a castling right.

z_ep

Returns the zobrist hash for a given zobrist square.

z_no_pawns

Returns the Zobrist Hash for having no pawns.

z_side

Returns the Zobrist Hash for having a Black Player's turn.

z_square

Returns the Zobrist hash for a given square, and player / piece at that square.