forked from hoshir/zebra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
patterns.h
145 lines (99 loc) · 3.41 KB
/
patterns.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
File: patterns.h
Created: July 4, 1997
Modified: August 1, 2002
Author: Gunnar Andersson ([email protected])
Contents: The patterns.
*/
#ifndef PATTERNS_H
#define PATTERNS_H
#include "constant.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Predefined two-bit patterns. */
#define EMPTY_PATTERN 0
#define BLACK_PATTERN 1
#define WHITE_PATTERN 2
/* Board patterns used in position evaluation */
#define PATTERN_COUNT 46
#define AFILEX1 0
#define AFILEX2 1
#define AFILEX3 2
#define AFILEX4 3
#define BFILE1 4
#define BFILE2 5
#define BFILE3 6
#define BFILE4 7
#define CFILE1 8
#define CFILE2 9
#define CFILE3 10
#define CFILE4 11
#define DFILE1 12
#define DFILE2 13
#define DFILE3 14
#define DFILE4 15
#define DIAG8_1 16
#define DIAG8_2 17
#define DIAG7_1 18
#define DIAG7_2 19
#define DIAG7_3 20
#define DIAG7_4 21
#define DIAG6_1 22
#define DIAG6_2 23
#define DIAG6_3 24
#define DIAG6_4 25
#define DIAG5_1 26
#define DIAG5_2 27
#define DIAG5_3 28
#define DIAG5_4 29
#define DIAG4_1 30
#define DIAG4_2 31
#define DIAG4_3 32
#define DIAG4_4 33
#define CORNER33_1 34
#define CORNER33_2 35
#define CORNER33_3 36
#define CORNER33_4 37
#define CORNER42_1 38
#define CORNER42_2 39
#define CORNER42_3 40
#define CORNER42_4 41
#define CORNER42_5 42
#define CORNER42_6 43
#define CORNER42_7 44
#define CORNER42_8 45
#define CORNER52_1 38
#define CORNER52_2 39
#define CORNER52_3 40
#define CORNER52_4 41
#define CORNER52_5 42
#define CORNER52_6 43
#define CORNER52_7 44
#define CORNER52_8 45
extern int pow3[10];
/* Connections between the squares and the bit masks */
extern int row_no[100];
extern int row_index[100];
extern int col_no[100];
extern int col_index[100];
extern int color_pattern[3];
/* The patterns describing the current state of the board. */
extern int row_pattern[8];
extern int col_pattern[8];
/* Symmetry maps */
extern int flip8[6561];
/* Masks which represent dependencies between discs and patterns */
extern unsigned int depend_lo[100];
extern unsigned int depend_hi[100];
/* Bit masks that show what patterns have been modified */
extern unsigned int modified_lo;
extern unsigned int modified_hi;
void
init_patterns( void );
void
compute_line_patterns( int *in_board );
#ifdef __cplusplus
}
#endif
#endif /* PATTERNS_H */