add new version of guessing game

attempt #2 at learning rust (i forget basic concepts)
This commit is contained in:
NullBite 2023-09-30 00:19:56 -04:00
parent 65dc3780e4
commit 29f2c99be0
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
3 changed files with 30 additions and 0 deletions

7
guessing_game_refresher/Cargo.lock generated Normal file
View 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_refresher"
version = "0.1.0"

View File

@ -0,0 +1,8 @@
[package]
name = "guessing_game_refresher"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -0,0 +1,15 @@
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}");
}