| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| README.md | ||
Guessing Rust
Guessing Rust is an advanced command-line guessing game written in Rust. It features multiple difficulty levels, a scoring system, and colorful terminal output.
Features
- Three difficulty levels: Easy, Medium, and Hard
- Dynamic scoring system based on attempts and time taken
- Colorful terminal output for enhanced user experience
- Replay option to enjoy multiple game sessions
Prerequisites
Before you begin, ensure you have Rust and Cargo installed on your system. If not, you can install them from https://www.rust-lang.org/.
Installation
-
Clone this repository:
git clone https://github.com/developtheweb/guessing_rust.git cd guessing_rust -
Build the project:
cargo build
How to Play
-
Run the game:
cargo run -
Choose a difficulty level:
- Easy: Numbers from 1 to 50, 10 attempts
- Medium: Numbers from 1 to 100, 7 attempts
- Hard: Numbers from 1 to 200, 5 attempts
-
Start guessing! The game will provide feedback on whether your guess is too high or too low.
-
Try to guess the number within the given attempts to win.
-
Your score is calculated based on the number of attempts and time taken. The faster you guess, the higher your score!
-
After each game, you can choose to play again or exit.
Project Structure
src/main.rs: Contains the main game logicCargo.toml: Defines project dependencies
Dependencies
This project uses the following external crates:
rand: For generating random numberstermion: For colorful terminal output
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is open source and available under the MIT License.
Acknowledgments
- Rust Programming Language Team
- Contributors to the
randandtermioncrates
Enjoy the game and happy coding!