Add Pseudo Move Generator #12

Merged
Josh merged 17 commits from 7-add-pseudo-move-generator into main 2025-08-18 00:28:00 +00:00
Showing only changes of commit a31b3ca265 - Show all commits

View File

@@ -38,6 +38,23 @@ enum Castling {
CASTLE_BQ = 1 << 3 CASTLE_BQ = 1 << 3
}; };
enum MoveFlags {
MF_NONE = 0,
MF_CAPTURE = 1 << 0,
MF_PROMO = 1 << 1,
MF_ENPASSANT = 1 << 2,
MF_CASTLE = 1 << 3,
MF_DOUBLE_PUSH = 1 << 4,
};
struct Move {
uint16_t from;
uint16_t to;
uint8_t piece;
uint8_t promo;
uint8_t flags;
}
struct Board { struct Board {
uint64_t pieces[12]; // Each set of pieces get a bitboard for each player. uint64_t pieces[12]; // Each set of pieces get a bitboard for each player.
uint64_t occ[3]; // Color occupancy bitboards. uint64_t occ[3]; // Color occupancy bitboards.
@@ -55,4 +72,5 @@ struct Board {
void create_knight_attack_cache(); void create_knight_attack_cache();
void create_pawn_attack_cache(); void create_pawn_attack_cache();
void create_king_attack_cache(); void create_king_attack_cache();
void print_board(); void print_board();
int gen_pseudo_moves(const struct Board *b, Move *out, bool captures_only);