From a0546278638c091bec705f8b06d236fb1a2d224b Mon Sep 17 00:00:00 2001 From: woosh <> Date: Thu, 16 Nov 2023 05:30:51 +0000 Subject: [PATCH] UT_DEPTH should be max distance to leaves ig --- uttt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uttt.c b/uttt.c index 850a4a7..0f14cff 100644 --- a/uttt.c +++ b/uttt.c @@ -839,7 +839,7 @@ int ut_alphabetaq(const struct ut_state *state, struct ut_move move, int depth, } return q; } -#define UT_DEPTH 5 +#define UT_DEPTH 6 struct ut_move ut_minimax(const struct ut_state *state) { struct ut_move best_move = {-1, -1}; @@ -848,7 +848,7 @@ struct ut_move ut_minimax(const struct ut_state *state) for(int c = 0; c < 9; c++) { struct ut_move move = (struct ut_move){r, c}; - int q = ut_alphabetaq(state, move, UT_DEPTH, UT_VALUEMIN - 1, UT_VALUEMAX + 1); + int q = ut_alphabetaq(state, move, UT_DEPTH - 1, UT_VALUEMIN - 1, UT_VALUEMAX + 1); if((state->player == 'X') ? q > best_q : q < best_q) { best_q = q;