-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathglobal.h
74 lines (57 loc) · 1.25 KB
/
global.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*Checkers*/
using namespace std;
enum {WHITE,BLACK,WHITE_KING,BLACK_KING,TOTAL_BITBOARD,EMPTY};
typedef unsigned long long int bb;
struct MOVE
{
int move;
int kingmove;
int who;
MOVE()
{
move=kingmove=who=0;
}
MOVE(int a, int b=0, int c = 0) {
move = a, kingmove = b, who = c;
}
};
int inc[][4] = {{7, 9, 0, 0}, {-7, -9, 0, 0}, {-7, -9, 7, 9}, {-7, -9, 7, 9}};
bb power[64];
char sidecolor[][7]={"WHITE\0", "BLACK\0"};
class BOARD
{
public:
int board[64];
int ply;
stack<MOVE> his;
int side;
bb bitboard[TOTAL_BITBOARD];
int bestmove;
//initialize
void init();
void checkState();
void parseFEN(char *);
//Move generator
void moveGen(vector<MOVE> &moveList);
void kingGen(vector<MOVE> &moveList);
void genallmoves(vector<MOVE> &);
void makeMove(MOVE);
void unmakeMove();
int killMove(int from, int move, int, int,vector<MOVE> &moveList);
int kingKillMove(int, int, int, int, int, vector<MOVE>&);
// print functions
void printBoard();
void printMove(int move);
void printMoveList(vector<MOVE> &moveList);
void printBitboard(bb a);
// evaluate
int evaluate();
//search
int maxx(int depth);
int minn(int depth);
MOVE search(int depth);
bool Valid(int,int,int);
//protocol
void parse(int ,char **);
void genFEN();
};