Add docs and preview

main
BlitDev 2022-06-10 12:17:18 +07:00
parent 49660e0549
commit 692463182a
Signed by: BlitDev
GPG Key ID: CB277ECC0702D30F
4 changed files with 27 additions and 3 deletions

1
.gitattributes vendored 100644
View File

@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text

20
README.MD 100644
View File

@ -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)

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0709d0c2744a82f7f845e090b9f90f791a54a29e52a7238eebb12ffde2f6e4c4
size 41731

View File

@ -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;
}
}