110 #include <sys/time.h>
111 #include <sys/resource.h>
171 printf(
"Options:\n");
172 printf(
"Options must be entered in the form '[set] <option> [=] <value>', with [set] and\n[=] being optional.\n");
173 printf(
" verbose [n] set Edax verbosity (default 1).\n");
174 printf(
" noise [n] start displaying Edax search result from this depth\n (default 5).\n");
175 printf(
" witdh [n] display edax search results using <width> characters\n (default 80).\n");
176 printf(
" hash-table-size [n] set hashtable size (default 18 bits).\n");
177 printf(
" n-tasks [n] control the number of parallel threads used in searching\n (default 1).\n");
178 printf(
" l|level [n] search using limited depth (default 21).\n");
179 printf(
" t|game-time <time> search using limited time per game.\n");
180 printf(
" move-time <time> search using limited time per move.\n");
181 printf(
" ponder [on/off] set pondering on/off.\n");
182 printf(
" book-file [file] use [file] as default book file (default data/book.dat).\n");
183 printf(
" book-usage [on/off] use or do not use the opening book.\n");
184 printf(
" book-randomness [n] play various but worse moves from the opening book.\n");
185 printf(
" auto-start [on/off] automatically start a new game.\n");
186 printf(
" auto-swap [on/off] automatically swap players between each game.\n");
187 printf(
" auto-store [on/off] automatically store each game into the opening book.\n");
195 printf(
"\nCommands:\n");
196 printf(
"Commands must be entered in the form '<command> <parameters>'.\n");
197 printf(
" i|nit start a new game from standard initial position.\n");
198 printf(
" n|ew start a new game from a personalized position.\n");
199 printf(
" setboard <board> set a personalized position to start from.\n");
200 printf(
" o|open|load [file] load a played game.\n");
201 printf(
" s|save [file] save a played game.\n");
202 printf(
" q|quit|exit quit from edax.\n");
203 printf(
" u|undo undo the last played move.\n");
204 printf(
" r|redo redo the last played move.\n");
205 printf(
" play <moves> play a sequence of moves.\n");
206 printf(
" force <moves> force to play an opening.\n");
207 printf(
" go ask edax to play.\n");
208 printf(
" stop stop edax search.\n");
209 printf(
" hint [n] ask edax to search the first bestmoves.\n");
210 printf(
" m|mode [n] ask edax to automatically play (default = 3).\n");
211 printf(
" a|analyze [n] retro-analyze the game.\n");
212 printf(
" ?|help show this message.\n");
213 printf(
" v|version display the version number.\n");
221 printf(
"\nBook Commands:\n");
222 printf(
"Book Commands must be entered in the form 'b|book <command> <parameters>'.\n");
223 printf(
" new <n1> <n2> create a new empty book with level <n1> and depth <n2>.\n");
224 printf(
" load [file] load an opening book from a binary opening file.\n");
225 printf(
" merge [file] merge an opening book with the current opening book.\n");
226 printf(
" save [file] save an opening book to a binary opening file.\n");
227 printf(
" import [file] load an opening book from a portable text file.\n");
228 printf(
" export [file] save an opening book to a portable text file.\n");
229 printf(
" on use the opening book.\n");
230 printf(
" off do not use the opening book.\n");
231 printf(
" show display details about the current position.\n");
232 printf(
" info display book general information.\n");
233 printf(
" a|analyze [n] retro-analyze the game using the opening book.\n");
234 printf(
" randomness [n] play more various but worse move from the opening book.\n");
235 printf(
" depth [n] change book depth (up to which to add positions).\n");
236 printf(
" deepen [n] change book level & reevalute the whole book (very slow!).\n");
237 printf(
" fix fix the opening book: add missing links and negamax the\n whole book tree.\n");
238 printf(
" store add the last played game to the opening book.\n");
239 printf(
" deviate <n1> <n2> add positions by deviating with a relative error <n1> and\n an absolute error <n2>.\n");
240 printf(
" enhance <n1> <n2> add positions by improving score accuracy with a midgame\n error <n1> and an endcut error <n2>.\n");
241 printf(
" fill [n] add positions between existing positions.\n");
242 printf(
" prune remove unreachable positions.\n");
243 printf(
" subtree only keep positions from the current position.\n");
244 printf(
" add [file] add positions from a game base file (txt, ggf, sgf or\n wthor format).\n");
252 printf(
"\nGame DataBase :\n");
253 printf(
" convert [file_in] [file_out] convert between different format.\n");
254 printf(
" unique [file_in] [file_out] remove doublons in the base.\n");
255 printf(
" check [file_in] [n] check error in the last <n> moves.\n");
256 printf(
" correct [file_in] [n] correct error in the last <n> moves.\n");
257 printf(
" complete [file_in] complete a database by playing the last\n missing moves.\n");
258 printf(
" problem [file_in] [n] [file_out] build a set of <n> problems from a game\n database.\n");
266 printf(
"\nTests:\n");
267 printf(
" bench test edax speed.\n");
268 printf(
" microbench test CPU cycle speed of some major functions.\n");
269 printf(
" obftest [file] Test from an obf file.\n");
270 printf(
" script-to-obf [file]Convert a script to an obf file.\n");
271 printf(
" wtest [file] check the theoric scores of a wthor base file.\n");
272 printf(
" count games [d] compute the number of moves from the current position up\n to depth [d].\n");
273 printf(
" perft [d] same as above, but without hash table.\n");
274 printf(
" estimate [d] [n] estimate the number of moves from the current position up\n to depth [d].\n");
275 printf(
" count positions [d] compute the number of positions from the current position\n up to depth [d].\n");
276 printf(
" count shapes [d] compute the number of shapes from the current position up\n to depth [d].\n");
286 char *cmd = NULL, *param = NULL;
288 char book_file[FILENAME_MAX];
289 unsigned long long histogram[129][65];
340 putchar(
'>'); fflush(stdout);
346 warn(
"unexpected null command?\n");
351 if (*cmd ==
'\0' || *cmd ==
'#') {
354 }
else if (strcmp(cmd,
"help") == 0 || strcmp(cmd,
"?") == 0) {
355 if (*param ==
'\0' || strcmp(param,
"options") == 0)
help_options();
356 if (*param ==
'\0' || strcmp(param,
"commands") == 0)
help_commands();
357 if (*param ==
'\0' || strcmp(param,
"book") == 0)
help_book();
358 if (*param ==
'\0' || strcmp(param,
"base") == 0)
help_base();
359 if (*param ==
'\0' || strcmp(param,
"test") == 0)
help_test();
362 }
else if (strcmp(cmd,
"i") == 0 || strcmp(cmd,
"init") == 0) {
369 }
else if ((strcmp(cmd,
"n") == 0 || strcmp(cmd,
"new") == 0) && *param ==
'\0') {
373 }
else if (strcmp(cmd,
"o") == 0 || strcmp(cmd,
"open") == 0 || strcmp(cmd,
"load") == 0) {
377 }
else if (strcmp(cmd,
"s") == 0 || strcmp(cmd,
"save") == 0) {
381 }
else if (strcmp(cmd,
"quit") == 0 || strcmp(cmd,
"q") == 0 || strcmp(cmd,
"exit") == 0) {
382 free(cmd); free(param);
386 free(cmd); free(param);
390 }
else if (strcmp(cmd,
"u") == 0 || strcmp(cmd,
"undo") == 0) {
395 }
else if (strcmp(cmd,
"r") == 0 || strcmp(cmd,
"redo") == 0) {
400 }
else if (strcmp(cmd,
"m") == 0 || strcmp(cmd,
"mode") == 0) {
404 }
else if (strcmp(cmd,
"a") == 0 || strcmp(cmd,
"analyze") == 0 || strcmp(cmd,
"analyse") == 0) {
408 }
else if (strcmp(cmd,
"setboard") == 0) {
412 }
else if (strcmp(cmd,
"vmirror") == 0) {
416 }
else if (strcmp(cmd,
"hmirror") == 0) {
420 }
else if (strcmp(cmd,
"rotate") == 0) {
422 if (angle < 0) angle += 360;
434 warn(
"Rotate angle should be 90°, 180° or 270°");
439 }
else if (strcmp(cmd,
"symetry") == 0) {
441 if (sym < 0 || sym >= 16)
warn(
"symetry parameter should be a number between 0 and 15\n");
443 if (sym & 8) play->
player ^= 1;
448 }
else if (strcmp(cmd,
"play") == 0) {
453 }
else if (strcmp(cmd,
"force") == 0) {
458 }
else if (strcmp(cmd,
"solve") == 0) {
459 char problem_file[FILENAME_MAX + 1], *hard_file;
460 hard_file =
parse_word(param, problem_file, FILENAME_MAX);
461 parse_word(hard_file, hard_file, FILENAME_MAX);
466 }
else if (strcmp(cmd,
"script-to-obf") == 0) {
467 char script_file[FILENAME_MAX + 1], *obf_file;
468 obf_file =
parse_word(param, script_file, FILENAME_MAX);
473 }
else if (strcmp(cmd,
"select-hard") == 0) {
474 char full_file[FILENAME_MAX + 1], *hard_file;
475 hard_file =
parse_word(param, full_file, FILENAME_MAX);
476 parse_word(hard_file, hard_file, FILENAME_MAX);
480 }
else if (strcmp(cmd,
"count") == 0) {
481 char count_cmd[16], *count_param;
482 int depth = 10, size = 8;
484 count_param =
parse_word(param, count_cmd, 15);
485 count_param =
parse_int(count_param, &depth);
BOUND(depth, 1, 90,
"max-ply");
486 if (count_param)
parse_int(count_param, &size);
BOUND(size, 6, 8,
"board-size");
488 if (strcmp(count_cmd,
"games") == 0) {
490 }
else if (strcmp(count_cmd,
"positions") == 0) {
492 }
else if (strcmp(count_cmd,
"shapes") == 0) {
495 warn(
"Unknown count command: \"%s %s\"\n", cmd, param);
498 }
else if (strcmp(cmd,
"perft") == 0) {
504 }
else if (strcmp(cmd,
"estimate") == 0) {
511 }
else if (strcmp(cmd,
"mobility") == 0) {
518 }
else if (strcmp(cmd,
"seek") == 0) {
526 printf(
"Solution found:\n");
532 }
else if (strcmp(cmd,
"microbench") == 0) {
536 }
else if (strcmp(cmd,
"bench") == 0) {
541 }
else if (strcmp(cmd,
"wtest") == 0) {
545 }
else if (strcmp(cmd,
"edaxify") == 0) {
549 }
else if (strcmp(cmd,
"weval") == 0) {
556 }
else if (strcmp(cmd,
"go") == 0) {
564 }
else if (strcmp(cmd,
"hint") == 0) {
569 }
else if (strcmp(cmd,
"stop") == 0) {
573 }
else if (strcmp(cmd,
"version") == 0 || strcmp(cmd,
"v") == 0) {
581 }
else if (strcmp(cmd,
"debug-pv") == 0) {
587 }
else if (strcmp(cmd,
"options") == 0) {
590 }
else if (strcmp(cmd,
"resources") == 0) {
593 getrusage(RUSAGE_SELF, &u);
594 t = 1000 * u.ru_utime.tv_sec + u.ru_utime.tv_usec / 1000;
595 printf(
"user cpu time: ");
time_print(t,
false, stdout); printf(
"\n");
596 t = 1000 * u.ru_stime.tv_sec + u.ru_stime.tv_usec / 1000;
597 printf(
"system cpu time: ");
time_print(t,
false, stdout); printf(
"\n");
598 printf(
"max resident memory: %ld\n", u.ru_maxrss);
599 printf(
"page fault without I/O: %ld\n", u.ru_minflt);
600 printf(
"page fault with I/O: %ld\n", u.ru_majflt);
601 printf(
"number of input: %ld\n", u.ru_inblock);
602 printf(
"number of output: %ld\n", u.ru_oublock);
603 printf(
"number of voluntary context switch: %ld\n", u.ru_nvcsw);
604 printf(
"number of unvoluntary context switch: %ld\n\n", u.ru_nivcsw);
607 }
else if (strcmp(cmd,
"opening") == 0) {
610 if (name == NULL) name =
"?";
614 }
else if (strcmp(cmd,
"ouverture") == 0) {
617 if (name == NULL) name =
"?";
621 }
else if (strcmp(cmd,
"book") == 0 || strcmp(cmd,
"b") == 0) {
622 char book_cmd[FILENAME_MAX + 1], *book_param;
628 book_param =
parse_word(param, book_cmd, FILENAME_MAX);
631 if (strcmp(book_cmd,
"store") == 0) {
635 }
else if (strcmp(book_cmd,
"on") == 0) {
639 }
else if (strcmp(book_cmd,
"off") == 0) {
643 }
else if (strcmp(book_cmd,
"randomness") == 0) {
644 val_1 = 0; book_param =
parse_int(book_param, &val_1);
648 }
else if (strcmp(book_cmd,
"depth") == 0) {
649 val_1 = 36; book_param =
parse_int(book_param, &val_1);
653 }
else if (strcmp(book_cmd,
"new") == 0) {
654 val_1 = 21; book_param =
parse_int(book_param, &val_1);
655 val_2 = 36; book_param =
parse_int(book_param, &val_2);
660 }
else if (strcmp(book_cmd,
"load") == 0 || strcmp(book_cmd,
"open") == 0) {
662 parse_word(book_param, book_file, FILENAME_MAX);
666 }
else if (strcmp(book_cmd,
"save") == 0) {
667 parse_word(book_param, book_file, FILENAME_MAX);
671 }
else if (strcmp(book_cmd,
"import") == 0) {
673 parse_word(book_param, book_file, FILENAME_MAX);
681 }
else if (strcmp(book_cmd,
"export") == 0) {
682 parse_word(book_param, book_file, FILENAME_MAX);
686 }
else if (strcmp(book_cmd,
"merge") == 0) {
688 parse_word(book_param, book_file, FILENAME_MAX);
693 warn(
"Book needs to be fixed before usage\n");
696 }
else if (strcmp(book_cmd,
"fix") == 0) {
703 }
else if (strcmp(book_cmd,
"negamax") == 0) {
708 }
else if (strcmp(book_cmd,
"correct") == 0) {
716 }
else if (strcmp(book_cmd,
"prune") == 0) {
724 }
else if (strcmp(book_cmd,
"subtree") == 0) {
732 }
else if (strcmp(book_cmd,
"show") == 0) {
736 }
else if (strcmp(book_cmd,
"info") == 0) {
740 }
else if (strcmp(book_cmd,
"stats") == 0) {
745 }
else if (strcmp(book_cmd,
"verbose") == 0) {
750 }
else if (strcmp(book_cmd,
"a") == 0 || strcmp(book_cmd,
"analyze") == 0 || strcmp(book_cmd,
"analyse") == 0) {
755 }
else if (strcmp(book_cmd,
"add") == 0) {
757 parse_word(book_param, book_file, FILENAME_MAX);
764 }
else if (strcmp(book_cmd,
"check") == 0) {
766 parse_word(book_param, book_file, FILENAME_MAX);
773 }
else if (strcmp(book_cmd,
"problem") == 0) {
774 val_1 = 24; book_param =
parse_int(book_param, &val_1);
BOUND(val_1, 0, 60,
"number of empties");
775 val_2 = 10; book_param =
parse_int(book_param, &val_2);
BOUND(val_2, 1, 1000000,
"number of positions");
779 }
else if (strcmp(book_cmd,
"extract") == 0) {
781 parse_word(book_param, book_file, FILENAME_MAX);
788 }
else if (strcmp(book_cmd,
"deviate") == 0) {
789 val_1 = 2; book_param =
parse_int(book_param, &val_1);
BOUND(val_1, -129, 129,
"relative error");
790 val_2 = 4; book_param =
parse_int(book_param, &val_2);
BOUND(val_2, 0, 65,
"absolute error");
794 }
else if (strcmp(book_cmd,
"enhance") == 0) {
795 val_1 = 2; book_param =
parse_int(book_param, &val_1);
BOUND(val_1, 0, 129,
"midgame error");
796 val_2 = 4; book_param =
parse_int(book_param, &val_2);
BOUND(val_2, 0, 129,
"endcut error");
800 }
else if (strcmp(book_cmd,
"fill") == 0) {
801 val_1 = 1; book_param =
parse_int(book_param, &val_1);
BOUND(val_1, 1, 61,
"fill depth");
805 }
else if (strcmp(book_cmd,
"play") == 0) {
809 }
else if (strcmp(book_cmd,
"deepen") == 0) {
813 }
else if (strcmp(book_cmd,
"feed-hash") == 0) {
818 warn(
"Unknown book command: \"%s %s\"\n", cmd, param);
824 }
else if (strcmp(cmd,
"base") == 0) {
825 char base_file[FILENAME_MAX + 1];
826 char base_cmd[512], *base_param;
830 base_param =
parse_word(param, base_cmd, 511);
831 base_param =
parse_word(base_param, base_file, FILENAME_MAX);
834 if (strcmp(base_cmd,
"problem") == 0) {
835 char problem_file[FILENAME_MAX + 1];
837 base_param =
parse_int(base_param, &n_empties);
838 base_param =
parse_word(base_param, problem_file, FILENAME_MAX);
844 }
else if (strcmp(base_cmd,
"tofen") == 0) {
845 char problem_file[FILENAME_MAX + 1];
847 base_param =
parse_int(base_param, &n_empties);
848 base_param =
parse_word(base_param, problem_file, FILENAME_MAX);
854 }
else if (strcmp(base_cmd,
"correct") == 0) {
856 base_param =
parse_int(base_param, &n_empties);
864 }
else if (strcmp(base_cmd,
"check") == 0) {
866 base_param =
parse_int(base_param, &n_empties);
872 }
else if (strcmp(base_cmd,
"complete") == 0) {
879 }
else if (strcmp(base_cmd,
"convert") == 0) {
881 base_param =
parse_word(base_param, base_file, FILENAME_MAX);
885 }
else if (strcmp(base_cmd,
"unique") == 0) {
887 base_param =
parse_word(base_param, base_file, FILENAME_MAX);
892 }
else if (strcmp(base_cmd,
"compare") == 0) {
893 char base_file_2[FILENAME_MAX + 1];
894 base_param =
parse_word(base_param, base_file_2, FILENAME_MAX);
898 warn(
"Unknown base command: \"%s %s\"\n", cmd, param);
913 }
else if (strcmp(cmd,
"nboard") == 0 && strcmp(param,
"1") == 0) {
914 free(cmd); free(param);
922 }
else if (strcmp(cmd,
"xboard") == 0) {
923 free(cmd); free(param);
931 }
else if (strcmp(cmd,
"engine-protocol") == 0 && strcmp(param,
"init") == 0) {
932 free(cmd); free(param);
939 }
else if (strcmp(cmd,
"protocol_version") == 0) {
940 free(cmd); free(param);
945 puts(
"= 2\n"); fflush(stdout);
951 }
else if (strcmp(cmd,
"tune") == 0) {
952 char problem[FILENAME_MAX];
955 w_name =
parse_word(param, problem, FILENAME_MAX);
961 warn(
"Unknown command/Illegal move: \"%s %s\"\n", cmd, param);
void base_to_problem(Base *base, const int n_empties, const char *problem)
Convert a game database to a set of problems.
Definition base.c:841
void base_analyze(Base *base, Search *search, const int n_empties, const bool apply_correction)
Base analysis.
Definition base.c:893
bool base_load(Base *base, const char *file)
Load a game database.
Definition base.c:740
void base_save(const Base *base, const char *file)
Save a game database.
Definition base.c:788
void base_complete(Base *base, Search *search)
Base analysis.
Definition base.c:919
void wthor_edaxify(const char *file)
Change players to "Edax (delorme)" and tourney to "Etudes" in a wthor base.
Definition base.c:651
void base_to_FEN(Base *base, const int n_empties, const char *problem)
Convert a game database to a set of problems.
Definition base.c:867
void base_unique(Base *base)
Make games unique in the game database.
Definition base.c:720
void wthor_eval(const char *file, Search *search, unsigned long long histogram[129][65])
Test Eval with a wthor base.
Definition base.c:611
void base_init(Base *base)
Initialize a game database.
Definition base.c:672
void wthor_test(const char *file, Search *search)
Test Search with a wthor base.
Definition base.c:516
void base_free(Base *base)
Free resources of a game database.
Definition base.c:684
void base_compare(const char *file_1, const char *file_2)
Base Compare.
Definition base.c:943
void board_init(Board *board)
Set a board to the starting position.
Definition board.c:280
int board_set(Board *board, const char *string)
Set a board from a string description.
Definition board.c:154
void book_extract_positions(Book *book, const int n_empties, const int n_positions)
print a set of position.
Definition book.c:2737
void book_check_base(Book *book, const Base *base)
Check positions from a game database.
Definition book.c:2644
void book_deepen(Book *book)
Deepen a book.
Definition book.c:1746
void book_show(Book *book, Board *board)
Display a position from the book.
Definition book.c:2155
void book_import(Book *book, const char *file)
Import an opening book.
Definition book.c:1547
void book_play(Book *book)
Play.
Definition book.c:1882
void book_subtree(Book *book, const Board *board)
Prune a book.
Definition book.c:2043
void book_enhance(Book *book, Board *board, const int midgame_error, const int endcut_error)
Enhance a book.
Definition book.c:2075
void book_info(Book *book)
display some book's informations.
Definition book.c:2111
void book_correct_solved(Book *book)
Correct wrong solved score in the book.
Definition book.c:1782
void book_negamax(Book *book)
Negamax a book.
Definition book.c:1684
void book_export(Book *book, const char *file)
Export an opening book.
Definition book.c:1589
void book_free(Book *book)
Free resources used by the opening book.
Definition book.c:1422
void book_save(Book *book, const char *file)
Save an opening book.
Definition book.c:1622
void book_fill(Book *book, const int depth)
Fill a book.
Definition book.c:1922
void book_fix(Book *book)
Fix a book.
Definition book.c:1723
void book_sort(Book *book)
Sort a book.
Definition book.c:1862
void book_merge(Book *dest, const Book *src)
Merge two opening books.
Definition book.c:1665
void book_link(Book *book)
Link a book.
Definition book.c:1701
void book_feed_hash(const Book *book, Board *board, Search *search)
feed hash table from the opening book.
Definition book.c:2824
void book_prune(Book *book)
Prune a book.
Definition book.c:2010
void book_stats(Book *book)
print book statistics.
Definition book.c:2773
void book_extract_skeleton(Book *book, Base *base)
Extract book draws to a game base.
Definition book.c:2709
void book_deviate(Book *book, Board *board, const int relative_error, const int absolute_error)
Deviate a book.
Definition book.c:1963
void book_new(Book *book, int level, int n_empties)
Create a new opening book.
Definition book.c:1450
void book_load(Book *book, const char *file)
Load the opening book.
Definition book.c:1471
void book_add_base(Book *book, const Base *base)
Add positions from a game database.
Definition book.c:2556
void engine_loop(void)
Loop event.
Definition cassio.c:683
@ BLACK
Definition const.h:42
void help_book(void)
print book's help.
Definition edax.c:219
bool book_verbose
Definition book.c:36
void bench(void)
perform various performance tests.
Definition bench.c:381
void ui_loop_edax(UI *ui)
Loop event.
Definition edax.c:284
static Log edax_log[1]
Definition edax.c:114
void help_commands(void)
print help commands.
Definition edax.c:193
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 help_test(void)
print base's help.
Definition edax.c:264
void help_options(void)
print help about options.
Definition edax.c:169
static void edax_observer(Result *result)
default search oberver.
Definition edax.c:124
void help_base(void)
print base's help.
Definition edax.c:250
void version(void)
Print version & copyright.
Definition main.c:27
void histogram_to_ppm(const char *file, unsigned long long histogram[129][65])
Definition histogram.c:156
void histogram_init(unsigned long long h[129][65])
Definition histogram.c:21
void histogram_stats(unsigned long long h[129][65])
Definition histogram.c:103
void histogram_print(unsigned long long h[129][65])
Definition histogram.c:30
void line_print(const Line *line, int width, const char *separator, FILE *f)
Print a move sequence.
Definition move.c:610
void move_print(const int x, const int player, FILE *f)
Print out a move.
Definition move.c:110
void line_init(Line *line, const int player)
Initialize a sequence of moves.
Definition move.c:549
void tune_move_evaluate(struct Search *, const char *, const char *)
void obf_speed(Search *search, const int n)
Definition obftest.c:534
void obf_filter(const char *input_file, const char *output_file)
Select hard position from an OBF file.
Definition obftest.c:437
void script_to_obf(Search *search, const char *script_file, const char *obf_file)
Build an OBF file from a Script file.
Definition obftest.c:378
void obf_test(Search *search, const char *obf_file, const char *wrong_file)
Test an OBF file.
Definition obftest.c:294
const char * opening_get_french_name(const Board *board)
Check if a board has got a french opening name.
Definition opening.c:1340
const char * opening_get_english_name(const Board *board)
Check if a board has got an engilsh opening name.
Definition opening.c:1321
Options options
Definition options.c:22
int options_read(const char *option, const char *value)
Read an option.
Definition options.c:136
void options_dump(FILE *f)
Print all global options.
Definition options.c:330
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 estimate_games(const Board *board, const long long n)
Move estimate games.
Definition perft.c:177
bool seek_position(const Board *target, const Board *board, Line *line)
seek a game that reach to a position
Definition perft.c:1115
void seek_highest_mobility(const Board *board, const unsigned long long t)
Move estimate games.
Definition perft.c:290
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
void count_games(const Board *board, const int depth)
Move generator performance test.
Definition perft.c:107
Move generator test header file.
void play_store(Play *play)
store the game into the opening book
Definition play.c:1175
void play_set_board(Play *play, const char *board)
Set a new board.
Definition play.c:810
void play_print(Play *play, FILE *f)
Print the game state.
Definition play.c:1225
void play_analyze(Play *play, int n)
Analyze a played game.
Definition play.c:1033
void play_hint(Play *play, int n)
Start thinking.
Definition play.c:365
void play_ponder(Play *play)
Ponder.
Definition play.c:729
void play_stop_pondering(Play *play)
Stop pondering.
Definition play.c:749
void play_book_analyze(Play *play, int n)
Analyze a played game.
Definition play.c:1140
void play_new(Play *play)
Start a new game.
Definition play.c:62
void play_save(Play *play, const char *file)
Save a played game.
Definition play.c:131
void play_init(Play *play, Book *book)
Initialization.
Definition play.c:27
const char * play_show_opening_name(Play *play, const char *(*opening_get_name)(const Board *))
Print the opening name.
Definition play.c:1438
bool play_user_move(Play *play, const char *string)
Play a user move.
Definition play.c:909
Move * play_get_last_move(Play *play)
Get the last played move.
Definition play.c:927
void play_force_init(Play *play, const char *string)
Initialize a forced line.
Definition play.c:1313
void play_game(Play *play, const char *string)
Play a move sequence.
Definition play.c:866
void play_symetry(Play *play, const int sym)
Get the symetry of the actual position.
Definition play.c:1418
bool play_load(Play *play, const char *file)
Load a saved game.
Definition play.c:84
void play_undo(Play *play)
Undo a move.
Definition play.c:779
bool play_is_game_over(Play *play)
Check if game is over.
Definition play.c:190
void play_redo(Play *play)
Redo a move.
Definition play.c:795
void play_go(Play *play, const bool update)
Start thinking.
Definition play.c:214
void play_free(Play *play)
Free resources.
Definition play.c:52
Edax play control - header file.
void pv_debug(Search *search, const Move *bestmove, FILE *f)
Debug PV.
Definition root.c:33
void result_print(Result *result, FILE *f)
Print the current search result.
Definition search.c:1106
void search_set_task_number(Search *search, const int n)
Change the number of task.
Definition search.c:847
void search_set_observer(Search *search, void(*observer)(Result *))
set observer.
Definition search.c:1095
void search_set_board(Search *search, const Board *board, const int player)
Set the board to analyze.
Definition search.c:593
int search_count_tasks(const Search *search)
Count the number of tasks used in parallel search.
Definition search.c:1324
void search_observer(Result *result)
default observer.
Definition search.c:1083
The opening book.
Definition book.h:25
int n_empties
Definition book.h:33
bool need_saving
Definition book.h:47
int verbosity
Definition book.h:36
Search * search
Definition book.h:49
LogFile.
Definition util.h:423
FILE * f
Definition util.h:424
bool book_allowed
Definition options.h:60
int n_task
Definition options.h:29
char * ui_log_file
Definition options.h:78
bool auto_start
Definition options.h:83
int repeat
Definition options.h:87
int book_randomness
Definition options.h:61
bool auto_quit
Definition options.h:86
int mode
Definition options.h:47
bool auto_swap
Definition options.h:85
char * book_file
Definition options.h:59
bool auto_store
Definition options.h:84
int verbosity
Definition options.h:32
int player
Definition play.h:32
Board board[1]
Definition play.h:26
int initial_player
Definition play.h:33
Board initial_board[1]
Definition play.h:27
int n_game
Definition play.h:36
Search search[1]
Definition play.h:28
int type
Definition play.h:31
Book * book
Definition play.h:30
int id
Definition search.h:101
struct Search::@25 options
int verbosity
Definition search.h:142
int type
Definition ui.h:36
Play play[2]
Definition ui.h:32
Book book[1]
Definition ui.h:33
void(* init)(struct UI *)
Definition ui.h:40
void(* loop)(struct UI *)
Definition ui.h:41
int mode
Definition ui.h:37
void(* free)(struct UI *)
Definition ui.h:42
bool ui_switch(UI *ui, const char *ui_type)
Switch between different User Interface.
Definition ui.c:25
bool ui_event_exist(UI *ui)
ui_event_exist
Definition ui.c:189
void ui_event_wait(UI *ui, char **cmd, char **param)
Wait input.
Definition ui.c:147
void time_print(long long t, bool justified, FILE *f)
Print time as "D:HH:MM:SS.CC".
Definition util.c:131
char * parse_move(const char *string, const Board *board, Move *move)
Parse a move.
Definition util.c:627
char * parse_int(const char *string, int *result)
Parse an integer.
Definition util.c:761
void string_to_lowercase(char *s)
Change all char of a string to lowercase.
Definition util.c:355
int string_to_int(const char *s, const int default_value)
Convert a string into an integer.
Definition util.c:457
char * parse_skip_spaces(const char *string)
Skip spaces.
Definition util.c:514
char * parse_word(const char *string, char *word, unsigned int n)
Parse a word.
Definition util.c:562
Miscellaneous utilities header.
#define log_close(l)
Close an opened log file.
Definition util.h:435
#define log_print(l,...)
Print into the log file.
Definition util.h:442
#define warn(...)
Display a warning message as "WARNING : ... ".
Definition util.h:373
#define log_open(l, file)
open a log file if allowed.
Definition util.h:429
#define log_is_open(l)
Check if the log stream can be used.
Definition util.h:448
#define BOUND(var, min, max, name)
Definition util.h:104