/
globals.h
127 lines (108 loc) · 2.11 KB
/
globals.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include <stdio.h>
#include <conio.h>
#include <memory.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <dos.h>
#include <time.h>
#include <assert.h>
/*
extern const int DARK = 1;
extern const int LIGHT = 2;
extern const int EMPTY = 0;
extern const int RED_MAN = 1;
extern const int BLACK_MAN = 2;
extern const int RED_KING = -1;
extern const int BLACK_KING = -2;
*/
#define DARK_PLAYER 0
#define LIGHT_PLAYER 1
#define DARK 0
#define LIGHT 1
#define EMPTY 0
#define RED_MAN -1
#define RED_KING -2
#define BLACK_MAN 1
#define BLACK_KING 2
#define RM -1
#define RK -2
#define BM 1
#define BK 2
#define BITBOARD int
#define MAX_PLY 100
extern int board[32];
extern int file[32];
extern int rank[32];
extern int edge[32];
extern int turn;
struct move
{
int from;
int to;
int score;
int last;
int jumps;
int eval;
int between[9];
int captured[9];
};
struct capture
{
int from;
int to;
int score;
int jumps;
int between;
int captured;
int last;
};
struct game
{
int from;
int to;
int jumps;
int between[9];
int captured[9];
int last;
int key;
int lock;
int fifty;
};
struct square
{
int nw;
int ne;
int se;
int sw;
int nw2;
int ne2;
int se2;
int sw2;
};
extern move movelist[10000];
extern game gamelist[10000];
extern capture capturelist[100];
extern square squares[32];
extern int firstmove[MAX_PLY];
extern int side,xside;
extern int ply,hply;
extern int nodes;
void MakeMove(const int from,const int to);
void MakeCapture(const int from,const int between,const int to);
void UnMakeMove();
void UnMakeCapture();
void MakeCaptures(const int from, const int to,const int,const int);
void UnMakeCaptures();
void ShowMovelist();
void ShowCapturelist();
int GenCaptures(const int s);
int GenCapture(const int s,const int sq);
int GenMoves(const int s);
int GenMove(const int s,const int sq);
int AddCapture(const int between,const int to);
void AddMove(const int from, const int to);
void SetSquares();
void SetBoard();
void DisplayBoard(const int,const int);
void z();