aboutsummaryrefslogtreecommitdiff
path: root/src/ctaklm.c
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-21 01:31:22 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commite1c9a014420648b2799509016b4fc52dec19bc2d (patch)
treedc7ef6bc9902245506053b96c2348e0fff9cb836 /src/ctaklm.c
parent19359dde885243e2359f7c560ae801efccee7294 (diff)
Renaming
Diffstat (limited to 'src/ctaklm.c')
-rw-r--r--src/ctaklm.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ctaklm.c b/src/ctaklm.c
index a1ca69d..da807c8 100644
--- a/src/ctaklm.c
+++ b/src/ctaklm.c
@@ -234,8 +234,8 @@ handle_turn(char *line) {
static void
new_game(uint8_t size) {
reset_state(size);
- printf("New %dx%d game! ct1986 at search depth %d.\n",
- size, size, ct1986_search_depth);
+ printf("New %dx%d game! negamax_cnn1986 at search depth %d.\n",
+ size, size, negamax_cnn1986_search_depth);
if (gamelog) gamelog = realloc(gamelog, sizeof(char));
else gamelog = malloc(sizeof(char));
gamelog[0] = 0;
@@ -296,9 +296,9 @@ load_ptn(const char* fn) {
static float sum_depth, num_check;
-// Set up output function for ct1986
+// Set up output function for negamax_cnn1986
inline void
-ct1986_display_progress(const uint8_t depth) {
+negamax_cnn1986_display_progress(const uint8_t depth) {
sum_depth += depth;
num_check += 1;
if (depth == 0) {
@@ -308,7 +308,7 @@ ct1986_display_progress(const uint8_t depth) {
}
static int
-ct1986_turn(void) {
+negamax_cnn1986_turn(void) {
if (won == 0xFF) {
// Prepare progress bar
fputs("Computing [", stdout);
@@ -317,7 +317,7 @@ ct1986_turn(void) {
fflush(stdout);
// Run the minimax
sum_depth = 0; num_check = 0;
- float minimax = ct1986_generate();
+ float minimax = negamax_cnn1986_generate();
fputs("\033[1C ", stdout);
// Failed to find a move?
if (minimax <= -infty) {
@@ -325,11 +325,11 @@ ct1986_turn(void) {
return EXIT_FAILURE;
} else {
printf("Result: %s (%.2f, %.1e, %.2f)\n",
- ct1986_ptn,
+ negamax_cnn1986_ptn,
minimax*100.0,
num_check,
sum_depth/num_check);
- handle_turn(ct1986_ptn);
+ handle_turn(negamax_cnn1986_ptn);
return EXIT_SUCCESS;
}
} else {
@@ -347,7 +347,7 @@ info, load, log, new, play (b|w), self-play, square <col><row>, <PTN>.");
} else if (!strcmp(line,"info")) {
print_info();
} else if (!strcmp(line,"eval")) {
- float eval = ct1986_evaluate_black_win()*100;
+ float eval = cnn1986_evaluate_black_win()*100;
if (ply & 1) {
printf("Black heuristic chance: %s%.2f%s\n",
blk, eval, rst);
@@ -360,12 +360,12 @@ info, load, log, new, play (b|w), self-play, square <col><row>, <PTN>.");
} else if (!strcmp(line,"new")) {
new_game(5);
} else if (!strcmp(line,"self-play")) {
- while (ct1986_turn() == 0);
+ while (negamax_cnn1986_turn() == 0);
} else if (!strncmp(line,"depth",5)) {
if (strnlen(line,7) == 7 && line[6] >= '0' && line[6] <= '9') {
- ct1986_search_depth = line[6] - '0';
+ negamax_cnn1986_search_depth = line[6] - '0';
printf("New search depth: %d.\n",
- ct1986_search_depth);
+ negamax_cnn1986_search_depth);
} else {
puts("Usage: depth [0-9].");
}
@@ -419,7 +419,7 @@ main(int argc, char **argv) {
(void)(argv);
human = 0;
- ct1986_search_depth = 3;
+ negamax_cnn1986_search_depth = 3;
new_game(5);
char *line = NULL;
@@ -447,7 +447,7 @@ main(int argc, char **argv) {
if (read == -1) {
playing = 0;
} else {
- ct1986_turn();
+ negamax_cnn1986_turn();
human = 0;
}
}