From 1373e30387bf5e8e7858e10c9dee4413bf20d71c Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 14 Sep 2022 17:25:09 +0300 Subject: refactor: separate bitboard functionality --- src/board.h | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/board.h') diff --git a/src/board.h b/src/board.h index cf89794..e3309e2 100644 --- a/src/board.h +++ b/src/board.h @@ -1,4 +1,4 @@ -#include "types.h" +#include "bitboard.h" #define WHITE 0b0000 #define BLACK 0b0001 @@ -10,9 +10,6 @@ #define QUEEN 0b1000 #define KING 0b1010 -typedef U64 Bitboard; -#define BIT (U64)1 - typedef struct { Bitboard pieces[12]; BYTE side; @@ -31,11 +28,6 @@ enum enumSquare { a8, b8, c8, d8, e8, f8, g8, h8 }; -#define notAFile 0xFEFEFEFEFEFEFEFE -#define notBFile 0xFDFDFDFDFDFDFDFD -#define notGFile 0xBFBFBFBFBFBFBFBF -#define notHFile 0x7F7F7F7F7F7F7F7F - static const char* notation[64] = { "a1", "b1", "c1", "d1", "e1", "f1", "g1", "h1", "a2", "b2", "c2", "d2", "e2", "f2", "g2", "h2", @@ -56,11 +48,15 @@ static const char* pieces[] = { "♚", "♔", }; -void print_bitboard(Bitboard bb); -int pop_count(Bitboard bb); -void print_board(Board board); +#define notAFile 0xFEFEFEFEFEFEFEFE +#define notBFile 0xFDFDFDFDFDFDFDFD +#define notGFile 0xBFBFBFBFBFBFBFBF +#define notHFile 0x7F7F7F7F7F7F7F7F + Board parse_FEN(char* FEN); +void print_board(Board board); + void precompute_knight_attack_table(Bitboard table[64]); void precompute_king_attack_table(Bitboard table[64]); void precompute_pawn_attack_table(Bitboard table[64], BYTE color); -- cgit v1.2.3