UT_DEPTH should be max distance to leaves ig

このコミットが含まれているのは:
woosh 2023-11-16 05:30:51 +00:00
コミット a054627863
1個のファイルの変更2行の追加2行の削除

4
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;