summaryrefslogtreecommitdiff
path: root/include/ct1986.c
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2021-01-14 15:09:39 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commitc1773e2712c5878e5f40e47e4a463a14724f55a8 (patch)
tree9150b948e1023ec6d60ac1ad6ff2f3e63e531078 /include/ct1986.c
parent2a7b485265997d62625dc0ee5d8e91ede1c5f99f (diff)
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.
Diffstat (limited to 'include/ct1986.c')
-rw-r--r--include/ct1986.c4
1 files changed, 2 insertions, 2 deletions
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;