10 #include "montecarlo/montecarlo.h"
11 #include "montecasino/montecasino.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_MONTECASINO
, 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
, "montecasino")) {
37 engine
= E_MONTECASINO
;
38 } else if (!strcasecmp(optarg
, "uct")) {
41 fprintf(stderr
, "%s: Invalid -e argument %s\n", argv
[0], optarg
);
46 debug_level
= atoi(optarg
);
52 fprintf(stderr
, "Pachi version %s\n", PACHI_VERSION
);
53 fprintf(stderr
, "Usage: %s [-e random|montecarlo|montecasino] [-d DEBUG_LEVEL] [-s RANDOM_SEED] [ENGINE_ARGS]\n",
61 fprintf(stderr
, "Random seed: %d", seed
);
70 e
= engine_random_init(e_arg
); break;
72 e
= engine_montecarlo_init(e_arg
); break;
74 e
= engine_montecasino_init(e_arg
); break;
76 e
= engine_uct_init(e_arg
); break;
81 while (fgets(buf
, 256, stdin
)) {
83 fprintf(stderr
, "IN: %s", buf
);
86 board_print(b
, stderr
);