lots
[arrocco.git] / main.c
blob9fb445761be2b1e5fd0f4749d2aab3565f894af1
1 /* main.c
2 2 Mar 2007 */
4 /*
5 This file is part of Arrocco, which is Copyright 2007 Thomas Plick
6 (tomplick 'at' gmail.com).
8 Arrocco is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 Arrocco is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "all.c"
24 static Position * pos;
25 static Position children[20 * 512];
27 int main(int argc, char *argv[])
29 int offswitch, d, c, n, i;
30 Int64 nodeCount;
32 pos = malloc(sizeof(Position));
33 newPosition(pos);
35 int pieceArrangement[8] = {ROOK, KNIGHT, BISHOP, QUEEN,
36 KING, BISHOP, KNIGHT, ROOK};
37 for (c = 0; c < 8; c++){
38 setPieceAt(pos, 1 * 8 + c, WHITE(PAWN));
39 setPieceAt(pos, 6 * 8 + c, BLACK(PAWN));
40 setPieceAt(pos, c, WHITE(pieceArrangement[c]));
41 setPieceAt(pos, 7 * 8 + c, BLACK(pieceArrangement[c]));
44 for (d = 0; d <= 9; d++){
45 nodeCount = 0ULL;
46 offswitch = 0;
47 int value = alphaBeta(pos, children, d, -7777777, 7777777,
48 &nodeCount, &offswitch);
49 printf("%2d %4d %llu\n", d, value, nodeCount);
52 return 0;