UT_DEPTH should be max distance to leaves ig
このコミットが含まれているのは:
コミット
a054627863
4
uttt.c
4
uttt.c
|
@ -839,7 +839,7 @@ int ut_alphabetaq(const struct ut_state *state, struct ut_move move, int depth,
|
||||||
}
|
}
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
#define UT_DEPTH 5
|
#define UT_DEPTH 6
|
||||||
struct ut_move ut_minimax(const struct ut_state *state)
|
struct ut_move ut_minimax(const struct ut_state *state)
|
||||||
{
|
{
|
||||||
struct ut_move best_move = {-1, -1};
|
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++)
|
for(int c = 0; c < 9; c++)
|
||||||
{
|
{
|
||||||
struct ut_move move = (struct ut_move){r, 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)
|
if((state->player == 'X') ? q > best_q : q < best_q)
|
||||||
{
|
{
|
||||||
best_q = q;
|
best_q = q;
|
||||||
|
|
読み込み中…
新しいイシューから参照