10 #include "montecarlo/montecarlo.h"
11 #include "montecasino/montecasino.h"
12 #include "random/random.h"
20 int main(int argc
, char *argv
[])
22 struct board
*b
= board_init();
23 enum { E_RANDOM
, E_MONTECARLO
, E_MONTECASINO
, 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
, "montecasino")) {
36 engine
= E_MONTECASINO
;
37 } else if (!strcasecmp(optarg
, "uct")) {
40 fprintf(stderr
, "%s: Invalid -e argument %s\n", argv
[0], optarg
);
45 debug_level
= atoi(optarg
);
51 fprintf(stderr
, "Usage: %s [-e random|montecarlo|montecasino] [-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_montecasino_init(e_arg
); break;
74 e
= engine_uct_init(e_arg
); break;
79 while (fgets(buf
, 256, stdin
)) {
81 fprintf(stderr
, "IN: %s", buf
);
84 board_print(b
, stderr
);