6 const int EMPTY
= 0, PAWN
= 2, KNIGHT
= 4, BISHOP
= 6,
7 ROOK
= 8, QUEEN
= 10, KING
= 12;
9 const int pieceValues
[14] = {0, 0, 10, -10, 30, -30, 30, -30, 50, -50, 90, -90,
13 #define BLACK(x) (x+1)
15 inline bool isWhite(int x
){
16 return x
&& ((~x
) & 1);
19 inline bool isBlack(int x
){
24 inline int opponent(int x
){
28 int promoteTo(int pawn
, int piece
){
29 return (pawn
& 1) | piece
;
32 bool sameColor(int x
, int y
){
33 if (x
== 0 || y
== 0){
36 return !((x
^ y
) & 1);
40 bool sameColorNotZero(int x
, int y
){
41 return !((x
^ y
) & 1);