From c1773e2712c5878e5f40e47e4a463a14724f55a8 Mon Sep 17 00:00:00 2001 From: tslil Date: Thu, 14 Jan 2021 15:09:39 -0500 Subject: Better trained weights, an important oversight in minimax (steps <=) I still can't tell whether if ((ply & 1) == 0) this = this - 1.0; is correct. --- include/ct1986.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/ct1986.c') diff --git a/include/ct1986.c b/include/ct1986.c index 8378f8c..5b3125f 100644 --- a/include/ct1986.c +++ b/include/ct1986.c @@ -132,7 +132,7 @@ previous_ply(void) { } else if (cur_depth == max_depth) { \ /* We're at the bottom, evaluate */ \ this = ct1986_evaluate_black_win(); \ - if (min == 0) this = this - 1.0;\ + if ((ply & 1) == 0) this = this - 1.0; \ } else { \ /* We're not at the bottom, recurse first */ \ next_ply(); \ @@ -194,7 +194,7 @@ ct1986_minimax(const uint8_t cur_depth, const uint8_t max_depth, // just try everything... // For every number of steps - for (uint8_t steps = 1; steps < board_size && steps <= count; steps++) { + for (uint8_t steps = 1; steps <= board_size && steps <= count; steps++) { uint8_t idx, carry; for (idx = 0; idx < steps; idx++) drops[idx]=0; idx = 0; -- cgit v1.3.1