diff options
Diffstat (limited to 'src/ctaklm.c')
| -rw-r--r-- | src/ctaklm.c | 17 |
1 files changed, 12 insertions, 5 deletions
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? |
