Move ordering

This commit is contained in:
nora 2023-01-16 08:52:34 +01:00
parent 41d15d0c94
commit 468532bb62

View file

@ -156,8 +156,7 @@ impl Game for Connect4 {
fn possible_moves(&self) -> impl Iterator<Item = Self::Move> { fn possible_moves(&self) -> impl Iterator<Item = Self::Move> {
let board = self.clone(); let board = self.clone();
// FIXME: If we reorder the moves so that the potentially better ones (center) come first we get better. [3, 2, 4, 1, 5, 0, 6].into_iter().filter(move |col| board[*col].is_none())
(0..WIDTH).filter(move |col| board[*col].is_none())
} }
fn result(&self) -> State { fn result(&self) -> State {