Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use rand;
- use rand::Rng;
- fn main() {
- randomize_game();
- randomize_players();
- }
- fn randomize_players () {
- let mut s = String::new();
- println!("{}", s);
- let player_id = rand::thread_rng().gen_range(1,4);
- match player_id {
- 1 => (s = String::from("AMzel")),
- 2 => (s = String::from("CYn-zuul")),
- 3 => (s = String::from("KipPster")),
- _ => (s = String::from("Out of bounds")),
- };
- println!("Game: {}", s);
- }
- fn randomize_game() {
- let mut s = String::new();
- println!("{}", s);
- let game_id = rand::thread_rng().gen_range(1,8);
- //println!("# {}", game_id);
- match game_id {
- 1 => (s = String::from("Halo MCC")),
- 2 => (s = String::from("Black Ops 2")),
- 3 => (s = String::from("Black Ops 1")),
- 4 => (s = String::from("Modern Warfare 2")),
- 5 => (s = String::from("Modern Warefare 3")),
- 6 => (s = String::from("Star Wars Battlefront2")),
- 7 => (s = String::from("Star Wars Republic Commando")),
- _ => (s = String::from("Out of bounds")),
- };
- println!("Game: {}", s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement