Improve readability and remove redundant code
This commit is contained in:
@@ -22,7 +22,7 @@ pub fn negamax(
|
||||
let (mut best_move, mut best_score, mate_score) = (None, MIN_SCORE, -MATE_SCORE + plies as i32);
|
||||
let mut legal_moves = 0;
|
||||
|
||||
for mv in game.board.pseudo_moves_all(color) {
|
||||
for mv in game.board.pseudo_moves_all() {
|
||||
let move_parameters = MoveParameters::build(&game.board, &mv);
|
||||
game.board.make_move(&mv);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ pub fn driver(game: &mut Game, nodes: &mut u64, depth: u8) {
|
||||
}
|
||||
|
||||
let color = game.current_player();
|
||||
let pseudo_moves = game.board.pseudo_moves_all(color);
|
||||
let pseudo_moves = game.board.pseudo_moves_all();
|
||||
|
||||
for mv in pseudo_moves {
|
||||
let original_board = game.board.clone();
|
||||
|
||||
@@ -18,7 +18,7 @@ pub fn quiescence(game: &mut Game, mut alpha: i32, beta: i32) -> (Option<Move>,
|
||||
|
||||
let captures = game
|
||||
.board
|
||||
.pseudo_moves_all(color)
|
||||
.pseudo_moves_all()
|
||||
.into_iter()
|
||||
.filter(|m| !matches!(m.move_type, MoveType::Quiet));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user