Add external dep for rand

This commit is contained in:
Dan Buch 2017-12-21 22:25:39 -05:00
parent fc77000e3a
commit d5ea5ee7c7
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7
2 changed files with 13 additions and 1 deletions

View File

@ -4,3 +4,4 @@ version = "0.1.0"
authors = ["Dan Buch <daniel.buch@gmail.com>"]
[dependencies]
rand = "0.4.0"

View File

@ -1,3 +1,14 @@
use std::io;
fn main() {
println!("Hello, world!");
println!("Guess the number!");
println!("Please input your guess.");
let mut guess = String::new();
io::stdin().read_line(&mut guess)
.expect("Failed to read line");
println!("You guessed: {}", guess);
}