mirror of
https://github.com/Noratrieb/minmax.git
synced 2026-01-16 00:05:05 +01:00
wrap
This commit is contained in:
parent
5bfabd3cec
commit
6b5347b196
5 changed files with 89 additions and 20 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue