fix pruning bug, (increase in workset :()

This commit is contained in:
Daniel Olsen 2021-01-06 15:14:56 +01:00
parent 19dd0d3b2c
commit 410e2f3bea
2 changed files with 13 additions and 8 deletions

View File

@ -486,7 +486,7 @@ impl Game {
}, },
GameMove(1..=9, _, _) => { GameMove(1..=9, _, _) => {
let board = &mut self.boards[self.player]; let board = &mut self.boards[self.player];
if game_move.0 > self.factories.len() - 1 { if game_move.0 > self.factories.len() {
return Err("That factory is out of bounds"); return Err("That factory is out of bounds");
} }

View File

@ -27,6 +27,11 @@ fn main() -> Result<(), &'static str> {
game.do_move(GameMove(4, Tile::Blue, 2))?; game.do_move(GameMove(4, Tile::Blue, 2))?;
game.do_move(GameMove(0, Tile::Black, 4))?; game.do_move(GameMove(0, Tile::Black, 4))?;
game.do_move(GameMove(5, Tile::Black, 1))?;
game.do_move(GameMove(0, Tile::Blue, 3))?;
println!("{:#?}", game);
println!("{}", count_options(game, 1, 2)); println!("{}", count_options(game, 1, 2));
Ok(()) Ok(())