https://github.com/trinitronx/rust-guessing-game
Improved guessing game example from Rust book Ch. 2, w/quit commands
https://github.com/trinitronx/rust-guessing-game
Last synced: 4 days ago
JSON representation
Improved guessing game example from Rust book Ch. 2, w/quit commands
- Host: GitHub
- URL: https://github.com/trinitronx/rust-guessing-game
- Owner: trinitronx
- Created: 2023-08-25T18:27:38.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-25T18:40:12.000Z (almost 3 years ago)
- Last Synced: 2025-02-27T09:12:07.289Z (over 1 year ago)
- Language: Rust
- Homepage: https://github.com/trinitronx/rust-guessing-game
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rust-guessing-game
Improved guessing game example from Rust book Ch. 2, w/quit commands
## Requirements
* Rust (for compilation only)
## Building
### Manual
Compile using Cargo:
```sh
cargo build --release
```
## Usage
Run the program to guess the random number.
Enter '`q`' or '`quit`' to give up and exit early.
```sh
./target/release/guessing_game
Guess the number!
Please input your guess.
1
You guessed: 1
Too small!
Please input your guess.
50
You guessed: 50
Too small!
Please input your guess.
75
You guessed: 75
Too small!
Please input your guess.
88
You guessed: 88
Too big!
Please input your guess.
82
You guessed: 82
You win!
```