diff --git a/src/complexagent.rs b/src/complexagent.rs index aef764d..e0871f5 100644 --- a/src/complexagent.rs +++ b/src/complexagent.rs @@ -24,8 +24,20 @@ impl Agent for ComplexAgent { fn next_move(&mut self, board: &Board) -> Option<(usize, usize)> { problem_space(board, self.color) .iter() - .max_by_key(|(_, _, (_, c))| c) - .map(|&(i, j, (_, _))| (i, j)) + .map(|&(i, j, (board, c))| { + ( + i, + j, + c as i64 + // reduce # of adversarial moves + - problem_space(&board, self.color.flip()) + .into_iter() + .map(|(_, _, (_, c))| c as i64) + .count() as i64, + ) + }) + .max_by_key(|&(_, _, c)| c) + .map(|(i, j, _)| (i, j)) } fn name(&self) -> &'static str { diff --git a/src/game.rs b/src/game.rs index ab9f1db..7a4afc1 100644 --- a/src/game.rs +++ b/src/game.rs @@ -55,7 +55,7 @@ impl Game { self.step(i); - std::thread::sleep(Duration::from_millis(200)); + // std::thread::sleep(Duration::from_millis(200)); } } }