|
BenBot 1.7.5
A chess engine
|
Files | |
| file | Attacks.hpp |
| file | Magics.hpp |
| file | Move.hpp |
| file | MoveGen.hpp |
| file | Patterns.hpp |
| file | Perft.hpp |
| file | PseudoLegal.hpp |
Namespaces | |
| namespace | chess |
| namespace | chess::moves |
| namespace | chess::moves::magics |
| namespace | chess::moves::patterns |
| namespace | chess::moves::pseudo_legal |
Classes | |
| struct | chess::moves::Move |
| struct | chess::moves::PerftResult |
Functions | |
| template<Color Side> | |
| constexpr auto | chess::moves::num_squares_attacked (const Pieces &pieces, Bitboard targetSquares, Bitboard enemyPieces, bool includeKing=true) noexcept -> size_t |
| constexpr auto | operator<=> (const Move &first, const Move &second) noexcept -> std::strong_ordering |
| template<bool IsRoot = true> | |
| auto | perft (size_t depth, const game::Position &startingPosition) -> PerftResult |
| template<Color Side> | |
| constexpr auto | chess::moves::squares_attacked (const Pieces &pieces, Bitboard targetSquares, Bitboard enemyPieces) noexcept -> bool |
| constexpr auto | chess::moves::MAX_MOVES = 256uz |
| auto | chess::moves::magics::bishop (Square bishopPos, Bitboard occupiedSquares, Bitboard friendlyPieces) -> Bitboard |
| auto | chess::moves::magics::rook (Square rookPos, Bitboard occupiedSquares, Bitboard friendlyPieces) -> Bitboard |
| auto | chess::moves::magics::queen (Square queenPos, Bitboard occupiedSquares, Bitboard friendlyPieces) -> Bitboard |
| template<Color Side> | |
| constexpr auto | chess::moves::patterns::pawn_pushes (Bitboard starting) noexcept -> Bitboard |
| template<Color Side> | |
| constexpr auto | chess::moves::patterns::pawn_double_pushes (Bitboard starting) noexcept -> Bitboard |
| template<Color Side> | |
| constexpr auto | chess::moves::patterns::pawn_attacks (Bitboard starting) noexcept -> Bitboard |
| constexpr auto | chess::moves::patterns::knight (Bitboard starting) noexcept -> Bitboard |
| constexpr auto | chess::moves::patterns::bishop (Bitboard starting) noexcept -> Bitboard |
| constexpr auto | chess::moves::patterns::rook (Bitboard starting) noexcept -> Bitboard |
| constexpr auto | chess::moves::patterns::queen (Bitboard starting) noexcept -> Bitboard |
| constexpr auto | chess::moves::patterns::king (Bitboard starting) noexcept -> Bitboard |
| template<Color Side> | |
| constexpr auto | chess::moves::pseudo_legal::pawn_pushes (Bitboard startingPawns, Bitboard emptySquares) noexcept -> Bitboard |
| template<Color Side> | |
| constexpr auto | chess::moves::pseudo_legal::pawn_double_pushes (Bitboard startingPawns, Bitboard occupiedSquares) noexcept -> Bitboard |
| template<Color Side> | |
| constexpr auto | chess::moves::pseudo_legal::pawn_captures (Bitboard startingPawns, Bitboard enemyPieces) noexcept -> Bitboard |
| constexpr auto | chess::moves::pseudo_legal::knight (Bitboard startingKnights, Bitboard friendlyPieces) noexcept -> Bitboard |
| constexpr auto | chess::moves::pseudo_legal::bishop (Bitboard startingBishops, Bitboard emptySquares, Bitboard friendlyPieces) noexcept -> Bitboard |
| constexpr auto | chess::moves::pseudo_legal::rook (Bitboard startingRooks, Bitboard emptySquares, Bitboard friendlyPieces) noexcept -> Bitboard |
| constexpr auto | chess::moves::pseudo_legal::queen (Bitboard startingQueens, Bitboard emptySquares, Bitboard friendlyPieces) noexcept -> Bitboard |
| constexpr auto | chess::moves::pseudo_legal::king (Bitboard startingKing, Bitboard friendlyPieces) noexcept -> Bitboard |
| constexpr auto | castle_kingside (Color color) noexcept -> Move |
| constexpr auto | castle_queenside (Color color) noexcept -> Move |
| constexpr auto | promotion (File file, Color color, PieceType promotedType=PieceType::Queen) noexcept -> Move |
| constexpr auto | castle_queenside (Color color) noexcept -> Move |
| constexpr auto | promotion (File file, Color color, PieceType promotedType=PieceType::Queen) noexcept -> Move |
| constexpr auto | castle_queenside (Color color) noexcept -> Move |
| constexpr auto | promotion (File file, Color color, PieceType promotedType=PieceType::Queen) noexcept -> Move |
| constexpr auto | castle_queenside (Color color) noexcept -> Move |
| constexpr auto | promotion (File file, Color color, PieceType promotedType=PieceType::Queen) noexcept -> Move |
| constexpr auto | castle_queenside (Color color) noexcept -> Move |
| constexpr auto | promotion (File file, Color color, PieceType promotedType=PieceType::Queen) noexcept -> Move |
| constexpr auto | castle_queenside (Color color) noexcept -> Move |
| constexpr auto | promotion (File file, Color color, PieceType promotedType=PieceType::Queen) noexcept -> Move |
Classes for modeling moves. In the search tree, positions are nodes and moves are edges between them.
|
nodiscard |
Calculates all pseudo-legal bishop moves.
The returned move set includes possible captures (i.e., rays ending where an enemy piece is located), and also considers blocking friendly pieces.
Calculates all possible bishop moves from the given starting square.
Definition at line 152 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal bishop moves.
The returned move set includes possible captures (i.e., rays ending where an enemy piece is located), and also considers blocking friendly pieces.
Definition at line 328 of file PseudoLegal.hpp.
Creates a move encoding kingside ("short") castling for the given color.
Creates a move encoding queenside ("long") castling for the given color.
Creates a move encoding queenside ("long") castling for the given color.
Creates a move encoding queenside ("long") castling for the given color.
Creates a move encoding queenside ("long") castling for the given color.
Creates a move encoding queenside ("long") castling for the given color.
Creates a move encoding queenside ("long") castling for the given color.
Calculates all possible king moves from the given starting position. Typically the starting bitboard will have only a single bit set, but this method can technically calculate moves for both kings at once, if both of their positions are set in the bitboard sent to this function.
Definition at line 181 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal king moves.
Definition at line 163 of file PseudoLegal.hpp.
Calculates all possible knight moves from the given starting position.
Definition at line 128 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal knight moves.
Definition at line 156 of file PseudoLegal.hpp.
|
nodiscardconstexprnoexcept |
Returns the number of targetSquares that any of the pieces attack. This function considers only pseudo-legal moves, not strictly legal moves. King attacks will only be considered if includeKing is true.
| Side | The color that the pieces represent. |
Definition at line 131 of file Attacks.hpp.
|
nodiscardconstexprnoexcept |
Calculates all squares that are attacked by pawns from the given starting position and color. This can be used to calculate possible pawn captures.
Definition at line 120 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal pawn captures. The returned bitboard has 1 bits set where each pawn would land after making a capture. Note that this function does not generate possible en passant captures.
Definition at line 149 of file PseudoLegal.hpp.
|
nodiscardconstexprnoexcept |
Calculates all possible pawn double pushes for the given starting position and color.
Definition at line 105 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal pawn double pushes.
Definition at line 132 of file PseudoLegal.hpp.
|
nodiscardconstexprnoexcept |
Calculates all possible pawn pushes for the given starting position and color.
Definition at line 98 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal pawn pushes.
Definition at line 124 of file PseudoLegal.hpp.
|
|
nodiscard |
Calculates all pseudo-legal queen moves.
The returned move set includes possible captures (i.e., rays ending where an enemy piece is located), and also considers blocking friendly pieces.
Calculates all possible queen moves from the given starting square.
Definition at line 170 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal queen moves, taking blocking pieces into consideration.
The returned move set includes possible captures (i.e., rays ending where an enemy piece is located), and also considers blocking friendly pieces.
Definition at line 335 of file PseudoLegal.hpp.
|
nodiscard |
Calculates all pseudo-legal rook moves.
The returned move set includes possible captures (i.e., rays ending where an enemy piece is located), and also considers blocking friendly pieces.
Calculates all possible rook moves from the given starting square.
Definition at line 161 of file Patterns.hpp.
|
nodiscardconstexprnoexcept |
Calculates all pseudo-legal rook moves, taking blocking pieces into consideration.
The returned move set includes possible captures (i.e., rays ending where an enemy piece is located), and also considers blocking friendly pieces.
Definition at line 321 of file PseudoLegal.hpp.
|
nodiscardconstexprnoexcept |
Returns true if any of the pieces attacks any of the targetSquares. This function considers only pseudo-legal moves, not strictly legal moves.
| Side | The color that the pieces represent. |
Definition at line 81 of file Attacks.hpp.
|
inlineconstexpr |
The maximum number of moves that can be generated for a position. The actual maximum number of legal moves for any known position is 218, for the position R6R/3Q4/1Q4Q1/4Q3/2Q4Q/Q4Q2/pp1Q4/kBNN1KB1 w - - 0 1.
Definition at line 58 of file MoveGen.hpp.