diff options
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | include/tt_llcht.c | 3 | ||||
| -rw-r--r-- | include/tt_llcht.h | 2 | ||||
| -rw-r--r-- | src/ctaklm.c | 14 |
4 files changed, 6 insertions, 14 deletions
@@ -3,7 +3,6 @@ STRIP=strip IDIR=include DEFINES=-DDETERMINISTIC CFLAGS=-O3 -Wall -Wextra -Wpedantic -std=c99 -D_DEFAULT_SOURCE $(DEFINES) -I$(IDIR) -lm -LIBS= CTAK=include/tak.c CTAK_OBJS=$(CTAK:.c=.o) diff --git a/include/tt_llcht.c b/include/tt_llcht.c index b898b23..c3902af 100644 --- a/include/tt_llcht.c +++ b/include/tt_llcht.c @@ -21,7 +21,6 @@ // Variables // =================================================================== -uint32_t tt_num_cached; static tt_entry_t *table[TT_LLCHT_SIZE+1]; // =================================================================== @@ -76,8 +75,6 @@ int tt_insert(const uint64_t key, const enum TT_FLAG flag, table[idx] = new; } - tt_num_cached++; - return EXIT_SUCCESS; } diff --git a/include/tt_llcht.h b/include/tt_llcht.h index 90b4164..292c93c 100644 --- a/include/tt_llcht.h +++ b/include/tt_llcht.h @@ -44,8 +44,6 @@ typedef struct tt_node_s { #define TT_LLCHT_SIZE ((uint32_t)((1<<19) - 1)) -extern uint32_t tt_num_cached; - // =================================================================== // Methods // =================================================================== diff --git a/src/ctaklm.c b/src/ctaklm.c index 4ef02be..681f29c 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -313,16 +313,15 @@ load_ptn(const char* fn) { return EXIT_SUCCESS; } -static float sum_depth, num_check, progress; +static float num_check, progress; // Set up output function for negamax inline void negamax_display_progress(const uint8_t depth, const uint32_t length) { - sum_depth += depth; num_check += 1; if (depth == negamax_search_depth) { progress++; - printf("\x1B[1GComputing: %.0f/%d", + printf("\x1B[0GComputing: %.0f/%d", progress,length); fflush(stdout); } @@ -332,19 +331,18 @@ static int negamax_turn(void) { if (won == 0xFF) { // Run the minimax - sum_depth = 0; num_check = 0; progress = 0; + num_check = 0; progress = 0; float minimax = negamax_generate(); - printf(" [%d]\n", tt_num_cached); + putchar('\n'); // Failed to find a move? if (minimax <= -infty) { puts("Opponent failed to find a move!"); return EXIT_FAILURE; } else { - printf("Result: %s (%.2f, %.1e, %.2f)\n", + printf("Result: %s (%.2f, checked %.1e)\n", negamax_ptn, minimax*100.0, - num_check, - sum_depth/num_check); + num_check); return handle_turn(negamax_ptn); } } else { |
