aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/negamax.c3
-rw-r--r--src/ctaklm.c1
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) {