29 fprintf(stderr,
"Edax version " VERSION_STRING " " __DATE__
" " __TIME__);
32 fprintf(stderr,
" for Linux\n");
34 fprintf(stderr,
" for Windows\n");
35#elif defined(__APPLE__)
36 fprintf(stderr,
" for Apple\n");
38 fprintf(stderr,
"\n");
41 fprintf(stderr,
" This is debug module.\n\n");
44 fprintf(stderr,
"copyright 1998 - 2017 Richard Delorme\n\n");
53 fprintf(stderr,
"Usage: edax <protocol> <options>\n");
54 fprintf(stderr,
"User Interface Protocols:\n");
55 fprintf(stderr,
" -edax Edax's user interface (default)\n");
56 fprintf(stderr,
" -ggs Generic Game Server interface (play through internet)\n");
57 fprintf(stderr,
" -gtp Go Text Protocol.\n");
58 fprintf(stderr,
" -xboard xboard/winboard protocol.\n");
59 fprintf(stderr,
" -nboard NBoard protocol.\n");
60 fprintf(stderr,
" -cassio Cassio protocol.\n");
61 fprintf(stderr,
" -solve <problem_file> Automatic problem solver/checker.\n");
62 fprintf(stderr,
" -wtest <wthor_file> Test edax using WThor's theoric score.\n");
63 fprintf(stderr,
" -count <level> Count positions up to <level>.\n");
75int main(
int argc,
char **argv)
78 int i, r, level = 0, size = 8;
79 char *problem_file = NULL;
80 char *wthor_file = NULL;
81 char *count_type = NULL;
91 ui = (
UI*) malloc(
sizeof *ui);
92 if (ui == NULL)
fatal_error(
"Cannot allocate a user interface.\n");
99 for (i = 1; i < argc; i++) {
101 while (*arg ==
'-') ++arg;
102 if (strcmp(arg,
"v") == 0 || strcmp(arg,
"version") == 0)
version();
104 else if ((r = (
options_read(arg, argv[i + 1]))) > 0) i += r - 1;
105 else if (strcmp(arg,
"solve") == 0 && argv[i + 1]) problem_file = argv[++i];
106 else if (strcmp(arg,
"wtest") == 0 && argv[i + 1]) wthor_file = argv[++i];
107 else if (strcmp(arg,
"bench") == 0 && argv[i + 1]) n_bench = atoi(argv[++i]);
108 else if (strcmp(arg,
"count") == 0 && argv[i + 1]) {
109 count_type = argv[++i];
111 if (argv[i + 1] && strcmp(argv[i + 1],
"6x6") == 0) {
131 if (problem_file || wthor_file || n_bench) {
134 search->
options.
header =
" depth|score| time | nodes (N) | N/s | principal variation";
135 search->
options.
separator =
"------+-----+--------------+-------------+----------+---------------------";
137 if (problem_file)
obf_test(search, problem_file, NULL);
138 if (wthor_file)
wthor_test(wthor_file, search);
142 }
else if (count_type){
146 else if (strcmp(count_type,
"positions") == 0)
count_positions(board, level, size);
147 else if (strcmp(count_type,
"shapes") == 0)
count_shapes(board, level, size);
void wthor_test(const char *file, Search *search)
Test Search with a wthor base.
Definition base.c:516
void edge_stability_init(void)
Initialize the edge stability tables.
Definition board.c:956
void board_init(Board *board)
Set a board to the starting position.
Definition board.c:280
void engine_loop(void)
Loop event.
Definition cassio.c:683
@ UI_EDAX
Definition const.h:110
@ UI_CASSIO
Definition const.h:109
#define VERSION_STRING
Definition const.h:88
void ui_loop_edax(UI *ui)
Loop event.
Definition edax.c:284
void ui_init_edax(UI *ui)
initialize edax protocol.
Definition edax.c:137
void ui_free_edax(UI *ui)
free resources used by edax protocol.
Definition edax.c:157
void eval_close(void)
Free global resources allocated to the evaluation function.
Definition eval.c:494
void eval_open(const char *file)
Load the evaluation function features' weights.
Definition eval.c:265
int main()
Definition generate_count_flip.c:362
void hash_move_init(void)
Initialize global hash move data.
Definition hash-lock-free.c:70
void hash_code_init(void)
Initialize global hash code data.
Definition hash-lock-free.c:52
void usage(void)
Programme usage.
Definition main.c:51
void version(void)
Print version & copyright.
Definition main.c:27
void obf_speed(Search *search, const int n)
Definition obftest.c:534
void obf_test(Search *search, const char *obf_file, const char *wrong_file)
Test an OBF file.
Definition obftest.c:294
void options_usage(void)
Print options usage.
Definition options.c:90
void options_free(void)
free allocated resources.
Definition options.c:399
Options options
Definition options.c:22
int options_read(const char *option, const char *value)
Read an option.
Definition options.c:136
void options_parse(const char *file)
parse options from a file
Definition options.c:266
void options_bound(void)
Keep options between realistic values.
Definition options.c:288
void quick_count_games(const Board *board, const int depth, const int size)
Count games.
Definition perft.c:521
void count_shapes(const Board *board, const int depth, const int size)
Count shapes.
Definition perft.c:1077
void count_positions(const Board *board, const int depth, const int size)
Count positions.
Definition perft.c:822
Move generator test header file.
void search_init(Search *search)
Init the main search.
Definition search.c:351
void search_free(Search *search)
Free the search allocated ressource.
Definition search.c:441
void search_global_init(void)
Definition search.c:151
void statistics_init(void)
Intialization of the statistics.
Definition stats.c:26
void statistics_print(FILE *f)
Print statistics.
Definition stats.c:112
int n_task
Definition options.h:29
char * eval_file
Definition options.h:57
int verbosity
Definition options.h:32
const char * separator
Definition search.h:145
const char * header
Definition search.h:144
struct Search::@25 options
int type
Definition ui.h:36
void(* init)(struct UI *)
Definition ui.h:40
void(* loop)(struct UI *)
Definition ui.h:41
void(* free)(struct UI *)
Definition ui.h:42
void ui_event_init(UI *ui)
Create a new Othello User Interface.
Definition ui.c:206
bool ui_switch(UI *ui, const char *ui_type)
Switch between different User Interface.
Definition ui.c:25
void ui_event_free(UI *ui)
Free events.
Definition ui.c:220
int string_to_int(const char *s, const int default_value)
Convert a string into an integer.
Definition util.c:457
int get_cpu_number(void)
Get the number of cpus or cores on the machine.
Definition util.c:987
Miscellaneous utilities header.
#define fatal_error(...)
Display an error message as "FATAL_ERROR : file name : function name : line number : ....
Definition util.h:349