Generate random secret number

This commit is contained in:
Dan Buch 2017-12-21 22:27:49 -05:00
parent d5ea5ee7c7
commit 0f51230e76
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

View File

@ -1,8 +1,15 @@
extern crate rand;
use std::io;
use rand::Rng;
fn main() {
println!("Guess the number!");
let secret_number = rand::thread_rng().gen_range(1, 101);
println!("The secret number is: {}", secret_number);
println!("Please input your guess.");
let mut guess = String::new();