From a194be3fb7fd4c88b9477d464f7faf918ff18c31 Mon Sep 17 00:00:00 2001 From: Bassem Girgis Date: Fri, 16 Jul 2021 20:12:04 -0500 Subject: [PATCH] 1st step --- Cargo.lock | 7 +++++++ src/main.rs | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..ee5d790 --- /dev/null +++ b/Cargo.lock @@ -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" diff --git a/src/main.rs b/src/main.rs index e7a11a9..b85afc5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,15 @@ + + 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); }