aboutsummaryrefslogtreecommitdiff
path: root/include/negamax.c
diff options
context:
space:
mode:
authortslil clingman <tslil@posteo.de>2021-01-26 00:32:43 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit3d8b8a5179a9684d8b7c77c7015b17b95f7dd701 (patch)
tree5bed3a4abed4c273c438dd4f7ce8e1783bd2609f /include/negamax.c
parent9131e08817ae2f3bd58a8a0ba9f1e692ceb8604c (diff)
Actually it seems before i was mis-counting
Diffstat (limited to 'include/negamax.c')
-rw-r--r--include/negamax.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/negamax.c b/include/negamax.c
index 8b7345f..f6c4873 100644
--- a/include/negamax.c
+++ b/include/negamax.c
@@ -85,6 +85,7 @@ negamax_init(const uint8_t new_board_size) {
board_size = new_board_size;
action_list_init();
zobrist_init();
+ tt_init();
}
void
@@ -129,7 +130,7 @@ negamax(const uint8_t cur_depth, float alpha, float beta,
// Check win if far enough into the game
if (w == WIN_ROAD_BLACK || w == WIN_FLAT_BLACK) node_value = colour*infty;
else if (w == WIN_DRAW) node_value = 0; // Draw is fixed at neutral
- } else if (cur_depth > 1) {
+ } else if (cur_depth > 0) {
// If nobody won, or too early, recurse if not a leaf
node_value = -negamax(cur_depth - 1, -beta, -alpha, -colour);
} else {