1st step
This commit is contained in:
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "guessing_game"
|
||||||
|
version = "0.1.0"
|
||||||
14
src/main.rs
14
src/main.rs
@@ -1,3 +1,15 @@
|
|||||||
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
println!("Guess the number!");
|
||||||
|
|
||||||
|
println!("Please input your guess.");
|
||||||
|
|
||||||
|
let mut guess = String::new();
|
||||||
|
|
||||||
|
std::io::stdin()
|
||||||
|
.read_line(&mut guess)
|
||||||
|
.expect("Failed to read line");
|
||||||
|
|
||||||
|
println!("You guessed: {}", guess);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user