aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ctaklm.c11
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);