From 3d8b8a5179a9684d8b7c77c7015b17b95f7dd701 Mon Sep 17 00:00:00 2001 From: tslil clingman Date: Tue, 26 Jan 2021 00:32:43 -0500 Subject: Actually it seems before i was mis-counting --- include/negamax.c | 3 ++- src/ctaklm.c | 1 - 2 files changed, 2 insertions(+), 2 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 { diff --git a/src/ctaklm.c b/src/ctaklm.c index a3685db..6c37484 100644 --- a/src/ctaklm.c +++ b/src/ctaklm.c @@ -419,7 +419,6 @@ main(int argc, char **argv) { negamax_search_depth = 4; new_game(5); negamax_init(5); - tt_init(); // Test harness if (argc > 1) { -- cgit v1.2.3