11 #include "montecarlo/montecarlo.h"
12 #include "random/random.h"
21 int main(int argc
, char *argv
[])
23 struct board
*b
= board_init();
24 enum { E_RANDOM
, E_MONTECARLO
, E_UCT
} engine
= E_UCT
;
29 while ((opt
= getopt(argc
, argv
, "e:d:s:")) != -1) {
32 if (!strcasecmp(optarg
, "random")) {
34 } else if (!strcasecmp(optarg
, "montecarlo")) {
35 engine
= E_MONTECARLO
;
36 } else if (!strcasecmp(optarg
, "uct")) {
39 fprintf(stderr
, "%s: Invalid -e argument %s\n", argv
[0], optarg
);
44 debug_level
= atoi(optarg
);
50 fprintf(stderr
, "Pachi version %s\n", PACHI_VERSION
);
51 fprintf(stderr
, "Usage: %s [-e random|montecarlo|uct] [-d DEBUG_LEVEL] [-s RANDOM_SEED] [ENGINE_ARGS]\n",
58 fprintf(stderr
, "Random seed: %d\n", seed
);
67 e
= engine_random_init(e_arg
); break;
69 e
= engine_montecarlo_init(e_arg
); break;
71 e
= engine_uct_init(e_arg
); break;
76 while (fgets(buf
, 256, stdin
)) {
78 fprintf(stderr
, "IN: %s", buf
);
81 board_print(b
, stderr
);