Move search_final(int max_depth) {
init_zobrist();
Move best = {0};
for (int d = 1; d <= max_depth; d++) {
Move moves[256]; int n = generate_all_moves(moves, side_to_move);
int best_score = INT_MIN;
sort_moves_heuristic(moves, n, 0);
for (int i = 0; i < n; i++) {
if (!is_legal(moves[ i ], side_to_move)) continue;
make_move(moves[ i ], side_to_move);
int s = -alphabeta_tt(d - 1, INT_MIN + 1, INT_MAX - 1, 1, 1 - side_to_move);
undo_move(moves[ i ], side_to_move);
if (s > best_score) {
best_score = s;
best = moves[ i ];
}
}
}
return best;
[ i ]
eingefügt, wo es vermutlich weginterpretiert wurde.)Powered by mwForum 2.29.3 © 1999-2014 Markus Wichitill