Refactor some clippy-pedantic errors
This commit is contained in:
@@ -27,17 +27,17 @@ pub fn negamax(
|
||||
game.board.make_move(&mv);
|
||||
|
||||
if game.board.king_under_check(color) {
|
||||
game.board.unmake_move(move_parameters);
|
||||
game.board.unmake_move(&move_parameters);
|
||||
continue;
|
||||
}
|
||||
|
||||
legal_moves += 1;
|
||||
let move_score = -negamax(game, -beta, -alpha, depth - 1, plies + 1).1;
|
||||
game.board.unmake_move(move_parameters);
|
||||
game.board.unmake_move(&move_parameters);
|
||||
|
||||
if move_score > best_score {
|
||||
best_score = move_score;
|
||||
best_move = Some(mv)
|
||||
best_move = Some(mv);
|
||||
}
|
||||
|
||||
if move_score >= beta {
|
||||
@@ -50,9 +50,8 @@ pub fn negamax(
|
||||
if legal_moves == 0 {
|
||||
if game.board.king_under_check(color) {
|
||||
return (None, mate_score);
|
||||
} else {
|
||||
return (None, 0);
|
||||
}
|
||||
return (None, 0);
|
||||
}
|
||||
(best_move, best_score)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user