まとめてハンドリング extern crate rand; use rand::Rng; fn main() { println!("Game start!"); let rand_number = rand::thread_rng().gen_range(1, 10); println!("random nuumber is {}", rand_number); match rand_number { 1 => println!("one"), 2 => println!("two"), 3 => println!("three"), _ => println!("something else"), } }