match
This commit is contained in:
		
							parent
							
								
									f4066492ce
								
							
						
					
					
						commit
						da86a1dfdc
					
				
							
								
								
									
										31
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								src/main.rs
									
									
									
									
									
								
							@ -10,23 +10,28 @@ 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);
 | 
			
		||||
 | 
			
		||||
    game.do_move(GameMove(1, Tile::Red, 2))?;
 | 
			
		||||
    game.do_move(GameMove(4, Tile::Red, 2))?;
 | 
			
		||||
    let program = 2;
 | 
			
		||||
 | 
			
		||||
    game.do_move(GameMove(2, Tile::Red, 1))?;
 | 
			
		||||
    return match program {
 | 
			
		||||
        1 => {
 | 
			
		||||
            let rng = StdRng::seed_from_u64(42);
 | 
			
		||||
            let mut game = Game::new(2, rng)?;
 | 
			
		||||
            game.fill()?;
 | 
			
		||||
             println!("{:#?}", game);
 | 
			
		||||
 | 
			
		||||
    println!("{}", count_options(game, 0, 2));
 | 
			
		||||
    
 | 
			
		||||
              game.do_move(GameMove(1, Tile::Red, 2))?;
 | 
			
		||||
              game.do_move(GameMove(4, Tile::Red, 2))?;
 | 
			
		||||
 | 
			
		||||
    // calculate_options()?;
 | 
			
		||||
              game.do_move(GameMove(2, Tile::Red, 1))?;
 | 
			
		||||
 | 
			
		||||
    Ok(())
 | 
			
		||||
              println!("{}", count_options(game, 0, 2));
 | 
			
		||||
 | 
			
		||||
              Ok(())
 | 
			
		||||
        },
 | 
			
		||||
        2 => calculate_options(),
 | 
			
		||||
        _ => Err("Not a valid program")
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
fn run(rng: StdRng) -> Result<(), &'static str> {
 | 
			
		||||
@ -109,4 +114,4 @@ fn count_options(game: Game, depth: u8, treshold: u8) -> u128 {
 | 
			
		||||
    })
 | 
			
		||||
    .sum::<u128>()*/
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user