From 11956b2e940f5e1839efab187d898092e819a766 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Mon, 1 Feb 2021 21:46:24 -0500 Subject: Tried some naive iterative deepening. Work on TEI interface next If TEI is implemented, then i could make use of Morten's racetrack (https://github.com/MortenLohne/racetrack) and develop a quantitative measure of the bot's performance. This is the current priority. --- src/ctaklm.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/ctaklm.c') diff --git a/src/ctaklm.c b/src/ctaklm.c index 4d910c4..d790769 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -320,15 +320,22 @@ load_ptn(const char* fn) { } static float num_check, progress; +static uint8_t old_depth; // Set up output function for negamax inline void -negamax_display_progress(const uint8_t depth, const uint32_t length) { +negamax_display_progress(const uint8_t cur_depth, + const uint8_t init_depth, + const uint32_t length) { num_check += 1; - if (depth == negamax_search_depth) { + if (cur_depth == init_depth) { + if (init_depth != old_depth) { + old_depth = init_depth; + progress = 0; + } progress++; - printf("\x1B[0GComputing: %.0f/%d", - progress,length); + printf("\x1B[0GComputing: %.0f/%d @ D%d ", + progress, length, init_depth); fflush(stdout); } } @@ -337,7 +344,7 @@ static int negamax_turn(void) { if (won == 0xFF) { // Run the minimax - num_check = 0; progress = 0; + num_check = 0; progress = 0; old_depth = 0; float minimax = negamax_generate(); putchar('\n'); // Failed to find a move? -- cgit v1.2.3