13constexpr int MAX_MOVES = 256;
23extern std::array<std::array<Bitboard, Square::NB>, PieceType::NB> pseudoAttacks;
25extern std::array<std::array<Bitboard, Square::NB>, Color::NB> pawnAttacks;
26extern std::array<std::array<Bitboard, Square::NB>, Color::NB> pawnSinglePushes;
28const int BISHOP_ATTACK_NB = 0x1480;
29const int ROOK_ATTACK_NB = 0x19000;
31extern std::vector<Bitboard> bishopAttacks;
32extern std::vector<Bitboard> rookAttacks;
36template <GenerationType T>
39 std::array<Move, MAX_MOVES> moveList;
43 explicit MoveList(
const Position& position) : size(generateMoves<T>(position, moveList)) {}
46template <GenerationType>
47size_t generateMoves(
const Position& position, std::array<Move, MAX_MOVES>& moveList);
50int perft(
Position& position,
int , std::vector<Move>& moveStack) {
51 const size_t start = moveStack.size();
52 const size_t count = 0;
56 for (
size_t i = 0; i < count; ++i) {
57 const Move& move = moveStack[start + i];
58 position.doMove(move);
72 moveStack.resize(start);
76int perft(Position& position,
int depth,
bool verbose =
true) {
77 std::vector<Move> moveStack;
79 return perft<true>(position, depth, moveStack);
81 return perft<false>(position, depth, moveStack);
Definition position.hpp:16