forked from hoshir/zebra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
stable.h
81 lines (47 loc) · 1.24 KB
/
stable.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
/*
File: stable.h
Created: March 20, 1999
Modified: August 1, 2002
Authors: Gunnar Andersson ([email protected])
Contents: Interface to the code which conservatively estimates
the number of stable (unflippable) discs.
*/
#ifndef STABLE_H
#define STABLE_H
#include "bitboard.h"
#ifdef __cplusplus
extern "C" {
#endif
extern BitBoard last_black_stable, last_white_stable;
/*
COUNT_EDGE_STABLE
Returns the number of stable edge discs for COLOR.
*/
int
count_edge_stable( int color, BitBoard col_bits, BitBoard opp_bits );
/*
COUNT_STABLE
Returns the number of stable discs for COLOR.
Note: COUNT_EDGE_STABLE must have been called immediately
before this function is called *or you lose big*.
*/
int
count_stable( int color, BitBoard col_bits, BitBoard opp_bits );
/*
GET_STABLE
Determines what discs on BOARD are stable with SIDE_TO_MOVE to play next.
The stability status of all squares (black, white and empty)
is returned in the boolean vector IS_STABLE.
*/
void
get_stable( int *board,
int side_to_move,
int *is_stable );
void
init_stable( void );
void
finalize_stable( void );
#ifdef __cplusplus
}
#endif
#endif /* STABLE_H */