aboutsummaryrefslogtreecommitdiff
path: root/include/negamax_cnn1986.c
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-23 15:37:33 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit2439dc2ab6a6c2a840c2d2c1deb3949b7b88f415 (patch)
tree3c60d1bcec14531e1734f426013ef38d1d2f4df5 /include/negamax_cnn1986.c
parent3f919c40804f024737bcf4da85027a980db6eb23 (diff)
Not correct usage, need to try hashing
Diffstat (limited to 'include/negamax_cnn1986.c')
-rw-r--r--include/negamax_cnn1986.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/negamax_cnn1986.c b/include/negamax_cnn1986.c
index 6c834f1..1dd0e72 100644
--- a/include/negamax_cnn1986.c
+++ b/include/negamax_cnn1986.c
@@ -391,9 +391,13 @@ negamax_cnn1986(const uint8_t cur_depth, float alpha, float beta,
negamax_cnn1986_display_progress(cur_depth);
}
}
- // Insert into the cache if we're not too deep
+ // Insert into the cache if we're not too deep, and make it
+ // useable for both min and max (colour * colour == 1)
if (cur_depth < negamax_cnn1986_cache_threshold)
- cnn1986_cache_insert(alpha);
+ cnn1986_cache_insert(colour*alpha);
+ } else {
+ // Impose the colour
+ alpha *= colour;
}
return alpha;
}