-
Notifications
You must be signed in to change notification settings - Fork 4
/
moves.h
107 lines (64 loc) · 1.85 KB
/
moves.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
/*
File: moves.h
Created: June 30, 1997
Modified: August 1, 2002
Author: Gunnar Andersson (gunnar@radagast.se)
Contents: The move generator's interface.
*/
#ifndef MOVES_H
#define MOVES_H
#include "constant.h"
#ifdef __cplusplus
extern "C" {
#endif
/* The number of disks played from the initial position.
Must match the current status of the BOARD variable. */
extern int disks_played;
/* Holds the last move made on the board for each different
game stage. */
extern int last_move[65];
/* The number of moves available after a certain number
of disks played. */
extern int move_count[MAX_SEARCH_DEPTH];
/* The actual moves available after a certain number of
disks played. */
extern int move_list[MAX_SEARCH_DEPTH][64];
/* Directional flip masks for all board positions. */
extern const int dir_mask[100];
/* Increments corresponding to the different flip directions */
extern const int move_offset[8];
/* The directions in which there exist valid moves. If there are N such
directions for a square, the Nth element of the list is 0. */
extern int flip_direction[100][16];
/* Pointers to FLIPDIRECTION[][0]. */
extern int *first_flip_direction[100];
void
bitboard_move_generation( int side_to_move );
void
init_moves( void );
int
generate_specific( int curr_move, int side_to_move );
int
generate_move( int side_to_move );
void
generate_all( int side_to_move );
int
count_all( int side_to_move, int empty );
int
game_in_progress( void );
int
make_move( int side_to_move, int move, int update_hash );
int
make_move_no_hash( int side_to_move, int move );
void
unmake_move( int side_to_move, int move );
void
unmake_move_no_hash( int side_to_move, int move );
int
valid_move( int move, int side_to_move );
int
get_move( int side_to_move );
#ifdef __cplusplus
}
#endif
#endif /* MOVES_H */