Moving into rustbook namespace
This commit is contained in:
1
rustbook/guessing_game/.gitignore
vendored
Normal file
1
rustbook/guessing_game/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
target/
|
4
rustbook/guessing_game/Cargo.lock
generated
Normal file
4
rustbook/guessing_game/Cargo.lock
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
[root]
|
||||
name = "guessing_game"
|
||||
version = "0.1.0"
|
||||
|
6
rustbook/guessing_game/Cargo.toml
Normal file
6
rustbook/guessing_game/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "guessing_game"
|
||||
version = "0.1.0"
|
||||
authors = ["Dan Buch <daniel.buch@gmail.com>"]
|
||||
|
||||
[dependencies]
|
14
rustbook/guessing_game/src/main.rs
Normal file
14
rustbook/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);
|
||||
}
|
Reference in New Issue
Block a user