This is a simple console-based number guessing game implemented in Rust. The game generates a random number between 1 and 100, and the player's task is to guess this number.
To get a local copy up and running, follow these simple steps.
- Rust: You need to have Rust installed on your machine. You can download Rust from here.
- Clone the repo
git clone https://github.com/TrezorTop/rust-guess-number-game.git
- Change to the project directory
cd rust-guess-number-game
- Build the project
cargo build
- Run the project
cargo run
After running the project, you will be prompted to guess a number. Enter a number between 1 and 100. The game will tell you if your guess is too small, too big, or correct. If your guess is correct, you win and the game ends. If your guess is incorrect, you can keep guessing until you find the correct number.
This project is a great starting point for learning Rust. It covers various aspects of Rust such as:
- Use of external crates (rand in this case)
- Basic input/output
- Error handling
- Use of match expressions
- Looping constructs
Feel free to clone this project, explore the code, and modify it to enhance your understanding of Rust.