This commit is contained in:
nora 2023-01-09 10:47:36 +01:00
parent 5bfabd3cec
commit 6b5347b196
5 changed files with 89 additions and 20 deletions

View file

@ -29,6 +29,10 @@ impl<G: Game> PerfectPlayer<G> {
self
}
pub fn best_move(&self) -> G::Move {
self.best_move.expect("no move made yet")
}
fn minmax(&mut self, board: &mut G, player: Player, depth: usize) -> Score {
if let Some(max_depth) = self.max_depth && depth >= max_depth {
return board.rate(player);