Skip to content

Commit 9826f40

Browse files
updates
1 parent 5bf52a8 commit 9826f40

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

Rust/IRSS-PLW2L8KbM0O7aRi_Bt4YE1JuW9EdMs0ztR/guessing-game/Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "guessing-game"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
fn main() {
2+
let actual: &str = "blue";
3+
println!("Welcome to the guessing game!");
4+
println!("I have chosen a color: red, green or blue can you guess which?");
5+
println!("Enter your guess: red, green or blue");
6+
let input = std::io::stdin()
7+
.lines()
8+
.next()
9+
.expect("No input was read")
10+
.expect("There was an error when reading the input");
11+
println!("The color i chose was {actual}")
12+
}

0 commit comments

Comments
 (0)