PawnGeneration
Highly optimized pawn move generation using Bitboard arithmetic.
Unlike leaping pieces which are generated per-square, pawn pushes and attacks can be calculated in parallel for all pawns of a given color simultaneously using bitwise shifts.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PawnGeneration.type
Members list
Value members
Concrete methods
Computes all attacked squares by pawns, regardless of whether there is an enemy there. Used primarily to determine if the King is in check or squares are unsafe.
Computes all attacked squares by pawns, regardless of whether there is an enemy there. Used primarily to determine if the King is in check or squares are unsafe.
Attributes
Computes the double forward push for all pawns starting from their initial rank.
Computes the double forward push for all pawns starting from their initial rank.
Value parameters
- emptySquares
-
Bitboard of all currently empty squares.
- singlePushes
-
The result of the
singlePushesmethod.
Attributes
- Returns
-
A Bitboard of the squares the pawns will land on after a double push.
Computes all diagonal captures towards the East (H-file).
Computes all diagonal captures towards the East (H-file).
Value parameters
- enemies
-
Bitboard of enemy pieces (or En Passant target).
- pawns
-
Bitboard of pawns.
Attributes
Filters a target bitboard, returning only the squares that are not on the promotion rank for the given color.
Filters a target bitboard, returning only the squares that are not on the promotion rank for the given color.
Value parameters
- color
-
The color of the moving pawns.
- targets
-
Bitboard of candidate target squares.
Attributes
- Returns
-
Bitboard of targets that do not land on the promotion rank.
Filters a target bitboard, returning only the squares on the promotion rank for the given color.
Filters a target bitboard, returning only the squares on the promotion rank for the given color.
White promotes on Rank 8; Black promotes on Rank 1.
Value parameters
- color
-
The color of the moving pawns.
- targets
-
Bitboard of candidate target squares (e.g. result of
singlePushesoreastCaptures).
Attributes
- Returns
-
Bitboard of targets that land on the promotion rank.
Computes the single forward push for all pawns.
Computes the single forward push for all pawns.
Value parameters
- emptySquares
-
Bitboard of all currently empty squares.
- pawns
-
Bitboard of all pawns of the given color.
Attributes
- Returns
-
A Bitboard of the squares the pawns will land on after a single push.
Computes all diagonal captures towards the West (A-file).
Computes all diagonal captures towards the West (A-file).
Value parameters
- enemies
-
Bitboard of enemy pieces (or En Passant target).
- pawns
-
Bitboard of pawns.