match
This commit is contained in:
parent
f4066492ce
commit
da86a1dfdc
27
src/main.rs
27
src/main.rs
|
@ -11,22 +11,27 @@ use rand::prelude::*;
|
||||||
|
|
||||||
fn main() -> Result<(), &'static str> {
|
fn main() -> Result<(), &'static str> {
|
||||||
|
|
||||||
let rng = StdRng::seed_from_u64(42);
|
let program = 2;
|
||||||
let mut game = Game::new(2, rng)?;
|
|
||||||
game.fill()?;
|
|
||||||
println!("{:#?}", game);
|
|
||||||
|
|
||||||
game.do_move(GameMove(1, Tile::Red, 2))?;
|
return match program {
|
||||||
game.do_move(GameMove(4, Tile::Red, 2))?;
|
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> {
|
fn run(rng: StdRng) -> Result<(), &'static str> {
|
||||||
|
|
Loading…
Reference in New Issue