7 static Position children
[20 * 512];
9 int main(int argc
, char *argv
[])
11 int offswitch
, d
, c
, n
, i
;
14 pos
= malloc(sizeof(Position
));
17 int pieceArrangement
[8] = {ROOK
, KNIGHT
, BISHOP
, QUEEN
,
18 KING
, BISHOP
, KNIGHT
, ROOK
};
19 for (c
= 0; c
< 8; c
++){
20 setPieceAt(pos
, 1 * 8 + c
, WHITE(PAWN
));
21 setPieceAt(pos
, 6 * 8 + c
, BLACK(PAWN
));
22 setPieceAt(pos
, c
, WHITE(pieceArrangement
[c
]));
23 setPieceAt(pos
, 7 * 8 + c
, BLACK(pieceArrangement
[c
]));
26 for (d
= 0; d
<= 9; d
++){
29 int value
= alphaBeta(pos
, children
, d
, -7777777, 7777777,
30 &nodeCount
, &offswitch
);
31 printf("%2d %4d %llu\n", d
, value
, nodeCount
);