-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.h
More file actions
44 lines (32 loc) · 1013 Bytes
/
main.h
File metadata and controls
44 lines (32 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef MAIN_H
#define MAIN_H
#include <stdint.h>
#define COLOR_MASK 0b11000
#define BLACK 0b01000
#define WHITE 0b10000
#define TYPE_MASK 0b111
#define PAWN 0b001
#define ROOK 0b010
#define KNIGHT 0b011
#define BISHOP 0b100
#define KING 0b101
#define QUEEN 0b110
#define WHITE_KING_CASTLE_MASK 0b0001
#define WHITE_QUEEN_CASTLE_MASK 0b0010
#define BLACK_KING_CASTLE_MASK 0b0100
#define BLACK_QUEEN_CASTLE_MASK 0b1000
#define EMPTY 0b00000
typedef struct board_t
{
uint8_t board[64];
uint8_t castleRights;
uint8_t turn; // Black or whites turn to move
uint8_t whiteKing; // Position of the whte king
uint8_t blackKing; // Position of the black king
uint8_t fullMoves; // Increments after black has moved
uint8_t halfMoves; // Number of moves since the last capture or the last pawn move
int8_t enPassantTarget;
uint64_t hash;
uint64_t gameHashHistory[512]; // Contains the hashes of the previous board states
} Board;
#endif // MAIN_H