10 #include "montecarlo/montecarlo.h"
11 #include "random/random.h"
20 int main(int argc
, char *argv
[])
22 struct board
*b
= board_init();
23 enum { E_RANDOM
, E_MONTECARLO
, E_UCT
} engine
= E_UCT
;
28 while ((opt
= getopt(argc
, argv
, "e:d:s:")) != -1) {
31 if (!strcasecmp(optarg
, "random")) {
33 } else if (!strcasecmp(optarg
, "montecarlo")) {
34 engine
= E_MONTECARLO
;
35 } else if (!strcasecmp(optarg
, "uct")) {
38 fprintf(stderr
, "%s: Invalid -e argument %s\n", argv
[0], optarg
);
43 debug_level
= atoi(optarg
);
49 fprintf(stderr
, "Pachi version %s\n", PACHI_VERSION
);
50 fprintf(stderr
, "Usage: %s [-e random|montecarlo|uct] [-d DEBUG_LEVEL] [-s RANDOM_SEED] [ENGINE_ARGS]\n",
58 fprintf(stderr
, "Random seed: %d", 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
);