diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-09-14 17:25:09 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-09-14 17:25:09 +0300 |
commit | 1373e30387bf5e8e7858e10c9dee4413bf20d71c (patch) | |
tree | 21ec9888a613cfe454ccdefa3de2d37854a112f1 /src/board.h | |
parent | 2dfa7cecdacacf7ef84e1ca768db6d636e225a0c (diff) | |
download | j1chess-1373e30387bf5e8e7858e10c9dee4413bf20d71c.tar.gz |
refactor: separate bitboard functionality
Diffstat (limited to 'src/board.h')
-rw-r--r-- | src/board.h | 20 |
1 files changed, 8 insertions, 12 deletions
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); |