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",
59 fprintf(stderr
, "Random seed: %d", seed
);
68 e
= engine_random_init(e_arg
); break;
70 e
= engine_montecarlo_init(e_arg
); break;
72 e
= engine_uct_init(e_arg
); break;
77 while (fgets(buf
, 256, stdin
)) {
79 fprintf(stderr
, "IN: %s", buf
);
82 board_print(b
, stderr
);