Add docs and preview
parent
49660e0549
commit
692463182a
|
@ -0,0 +1 @@
|
|||
*.png filter=lfs diff=lfs merge=lfs -text
|
|
@ -0,0 +1,20 @@
|
|||
# Guess Game
|
||||
The game generates a secret number from 0 to 255. The player's task is to name a secret number.
|
||||
|
||||
## Requirements
|
||||
- Rust
|
||||
- Cargo
|
||||
|
||||
I recommend using [rustup](https://rustup.rs/) to install Rust.
|
||||
- Install rustup on Arch Linux: `sudo pacman -S rustup --needed`
|
||||
|
||||
## Building
|
||||
`cargo b` (debug build)
|
||||
|
||||
The executable files will be located in target/debug.
|
||||
|
||||
`cargo b --release` (release build, what you need 😀)
|
||||
|
||||
The executable files will be located in target/release.
|
||||
|
||||
[Preview](images/preview.png)
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0709d0c2744a82f7f845e090b9f90f791a54a29e52a7238eebb12ffde2f6e4c4
|
||||
size 41731
|
|
@ -9,8 +9,8 @@ fn main() {
|
|||
}
|
||||
|
||||
fn guess_number() {
|
||||
println!("{}", "== Guess the number! ==");
|
||||
println!("{}", "Min = 0; Max = 255\n");
|
||||
println!("== Guess the number! ==");
|
||||
println!("Min = 0; Max = 255\n");
|
||||
let mut iterator: u16 = 0;
|
||||
let secret_number: u8 = rand::thread_rng().gen_range(u8::MIN..=u8::MAX);
|
||||
|
||||
|
@ -41,7 +41,7 @@ fn guess_number() {
|
|||
break;
|
||||
}
|
||||
|
||||
println!("\nYou win :D ({} attempts)", iterator);
|
||||
println!("\nYou win :D ({} attempts before win)", iterator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue