This commit is contained in:
Daniel Olsen 2021-01-06 11:07:22 +01:00
parent f4066492ce
commit da86a1dfdc
1 changed files with 18 additions and 13 deletions

View File

@ -11,22 +11,27 @@ use rand::prelude::*;
fn main() -> Result<(), &'static str> {
let rng = StdRng::seed_from_u64(42);
let mut game = Game::new(2, rng)?;
game.fill()?;
println!("{:#?}", game);
let program = 2;
game.do_move(GameMove(1, Tile::Red, 2))?;
game.do_move(GameMove(4, Tile::Red, 2))?;
return match program {
1 => {
let rng = StdRng::seed_from_u64(42);
let mut game = Game::new(2, rng)?;
game.fill()?;
println!("{:#?}", game);
game.do_move(GameMove(2, Tile::Red, 1))?;
game.do_move(GameMove(1, Tile::Red, 2))?;
game.do_move(GameMove(4, Tile::Red, 2))?;
println!("{}", count_options(game, 0, 2));
game.do_move(GameMove(2, Tile::Red, 1))?;
println!("{}", count_options(game, 0, 2));
// calculate_options()?;
Ok(())
Ok(())
},
2 => calculate_options(),
_ => Err("Not a valid program")
}
}
fn run(rng: StdRng) -> Result<(), &'static str> {