Add external dep for rand
This commit is contained in:
parent
fc77000e3a
commit
d5ea5ee7c7
@ -4,3 +4,4 @@ version = "0.1.0"
|
|||||||
authors = ["Dan Buch <daniel.buch@gmail.com>"]
|
authors = ["Dan Buch <daniel.buch@gmail.com>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
rand = "0.4.0"
|
||||||
|
@ -1,3 +1,14 @@
|
|||||||
|
use std::io;
|
||||||
|
|
||||||
fn main() {
|
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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user