diff options
| author | tslil clingman <tslil@posteo.de> | 2021-01-17 01:23:37 -0500 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-08-28 19:37:41 +0100 |
| commit | 63ff6ead5af940356ab8f591ceffb8ae4ecf814b (patch) | |
| tree | 5ea4b6e5ca0dbfb0dd65cbbea7aa5f3b0f8448a8 /src/ctaklm.c | |
| parent | 571afc6c72709910636979e20c0dd82dd0c66a46 (diff) | |
Better status
Diffstat (limited to 'src/ctaklm.c')
| -rw-r--r-- | src/ctaklm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ctaklm.c b/src/ctaklm.c index 68441c0..d2208a0 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -298,8 +298,12 @@ load_ptn(const char* fn) { return EXIT_SUCCESS; } +static float sum_depth, num_check; + static void dot(const uint8_t depth) { + sum_depth += depth; + num_check += 1; if (depth == 0) { putchar('#'); fflush(stdout); @@ -314,14 +318,17 @@ ct1986_turn(const uint8_t max_depth) { fputs("]\033[26D",stdout); fflush(stdout); // Run the minimax + sum_depth = 0; num_check = 0; float minimax = ct1986_generate(max_depth); + printf("]\nChecked %.0f AvgD %.2f, ", + num_check, sum_depth/num_check); // Failed to find a move? if ((minimax <= -infty && (ply & 1) == 1) ||(minimax >= infty && (ply & 1) == 0)) { - puts("] Opponent concedes!"); + puts("Opponent concedes!"); return EXIT_FAILURE; } else { - printf("] Result: %s (%.3f)\n", + printf("Result: %s (%.3f)\n", ct1986_ptn, minimax*100.0); handle_turn(ct1986_ptn); |
