From e1c9a014420648b2799509016b4fc52dec19bc2d Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Thu, 21 Jan 2021 01:31:22 -0500 Subject: Renaming --- src/ct1986.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/ct1986.c') diff --git a/src/ct1986.c b/src/ct1986.c index b930b13..49a1075 100644 --- a/src/ct1986.c +++ b/src/ct1986.c @@ -3,13 +3,13 @@ #include #include -#include +#include const char* esc = "\x1B[L"; FILE *lcd = NULL; static char *gamelog = 0; -static int human, search_depth; +static int human; static void write_line(const char *line) { @@ -93,11 +93,10 @@ new_game(uint8_t size) { gamelog[0] = 0; } -// Set up output function for ct1986 - +// Set up output function for negamax_cnn1986 static uint8_t perc; inline void -ct1986_display_progress(const uint8_t depth) { +negamax_cnn1986_display_progress(const uint8_t depth) { if (depth == 0) { perc++; // back four spaces and clear line, followed by perc% @@ -109,12 +108,12 @@ ct1986_display_progress(const uint8_t depth) { } static int -ct1986_turn(const uint8_t search_depth) { +negamax_cnn1986_turn() { // Prepare progress bar fputs("Computing: ", lcd); fflush(lcd); // Run the minimax perc = 0; - float minimax = ct1986_generate(search_depth); + float minimax = negamax_cnn1986_generate(); fputc('\n', lcd); fflush(lcd); // Failed to find a move? if (minimax <= -infty) { @@ -123,8 +122,8 @@ ct1986_turn(const uint8_t search_depth) { } else { fprintf(lcd, "%s: %s\n", (ply & 1) ? "Black" : "White", - ct1986_ptn); - handle_turn(ct1986_ptn); + negamax_cnn1986_ptn); + handle_turn(negamax_cnn1986_ptn); return EXIT_SUCCESS; } } @@ -140,8 +139,8 @@ input_is_not_turn(const char *line) { case 'l': { do_game_log(); break; } case 'n': { new_game(5); break; } case 'd': { - search_depth = line[1] - '0'; - fprintf(lcd, "Search depth: %d\n", search_depth); + negamax_cnn1986_search_depth = line[1] - '0'; + fprintf(lcd, "Search depth: %d\n", negamax_cnn1986_search_depth); fflush(lcd); break; } @@ -161,7 +160,7 @@ main(int argc, char **argv) { if (lcd == NULL) return EXIT_FAILURE; human = 0; - search_depth = 1; + negamax_cnn1986_search_depth = 3; new_game(5); fprintf(lcd, "%sB", esc); fflush(lcd); @@ -188,7 +187,7 @@ main(int argc, char **argv) { break; } } - ct1986_turn(search_depth); + negamax_cnn1986_turn(); human = 0; } -- cgit v1.3.1