11 #include "replay/replay.h"
12 #include "montecarlo/montecarlo.h"
13 #include "random/random.h"
14 #include "patternscan/patternscan.h"
15 #include "t-unit/test.h"
24 int main(int argc
, char *argv
[])
26 struct board
*b
= board_init();
27 enum { E_RANDOM
, E_REPLAY
, E_PATTERNSCAN
, E_MONTECARLO
, E_UCT
} engine
= E_UCT
;
28 char *testfile
= NULL
;
33 while ((opt
= getopt(argc
, argv
, "e:d:s:t:")) != -1) {
36 if (!strcasecmp(optarg
, "random")) {
38 } else if (!strcasecmp(optarg
, "patternscan")) {
39 engine
= E_PATTERNSCAN
;
40 } else if (!strcasecmp(optarg
, "replay")) {
42 } else if (!strcasecmp(optarg
, "montecarlo")) {
43 engine
= E_MONTECARLO
;
44 } else if (!strcasecmp(optarg
, "uct")) {
47 fprintf(stderr
, "%s: Invalid -e argument %s\n", argv
[0], optarg
);
52 debug_level
= atoi(optarg
);
58 testfile
= strdup(optarg
);
61 fprintf(stderr
, "Pachi version %s\n", PACHI_VERSION
);
62 fprintf(stderr
, "Usage: %s [-e random|replay|patternscan|montecarlo|uct] [-d DEBUG_LEVEL] [-s RANDOM_SEED] [-t FILENAME] [ENGINE_ARGS]\n",
69 fprintf(stderr
, "Random seed: %d\n", seed
);
78 e
= engine_random_init(e_arg
); break;
80 e
= engine_replay_init(e_arg
); break;
82 e
= engine_patternscan_init(e_arg
); break;
84 e
= engine_montecarlo_init(e_arg
); break;
86 e
= engine_uct_init(e_arg
); break;
96 while (fgets(buf
, 4096, stdin
)) {
98 fprintf(stderr
, "IN: %s", buf
);