Working on the rust book moar
This commit is contained in:
parent
7e650db47f
commit
051f50ec61
2
rustfun/Cargo.lock → guessing_game/Cargo.lock
generated
2
rustfun/Cargo.lock → guessing_game/Cargo.lock
generated
@ -1,4 +1,4 @@
|
||||
[root]
|
||||
name = "rustfun"
|
||||
name = "guessing_game"
|
||||
version = "0.1.0"
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "rustfun"
|
||||
name = "guessing_game"
|
||||
version = "0.1.0"
|
||||
authors = ["Dan Buch <daniel.buch@gmail.com>"]
|
||||
|
14
guessing_game/src/main.rs
Normal file
14
guessing_game/src/main.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use std::io;
|
||||
|
||||
fn main() {
|
||||
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);
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
Loading…
Reference in New Issue
Block a user