aboutsummaryrefslogtreecommitdiff
path: root/include/negamax.c
diff options
context:
space:
mode:
Diffstat (limited to 'include/negamax.c')
-rw-r--r--include/negamax.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/negamax.c b/include/negamax.c
index 0ec40e5..584b43c 100644
--- a/include/negamax.c
+++ b/include/negamax.c
@@ -26,6 +26,7 @@ const float infty = 3.0;
char negamax_ptn[9];
uint8_t negamax_search_depth = 3;
static uint64_t negamax_best_action;
+static nn_function evaluate;
// ===================================================================
// Helper declarations
@@ -43,6 +44,12 @@ void negamax_init(const uint8_t new_board_size) {
action_list_init(new_board_size);
zobrist_init(new_board_size);
tt_init();
+
+ if (new_board_size == 5) {
+ evaluate = &nn1986_evaluate_black_win;
+ } else {
+ evaluate = &nn2690_evaluate_black_win;
+ }
}
void negamax_free(void) { zobrist_free(); }
@@ -132,7 +139,7 @@ static float negamax(tak_state_p state, const uint8_t cur_depth,
node_value = -negamax(state, cur_depth - 1, init_depth, -beta, -alpha,
-colour, zobrist_compute(state));
} else {
- node_value = colour * nn1986_evaluate_black_win(state);
+ node_value = colour * evaluate(state);
}
action_undo(state, node->action);