https://roadmap.sh/projects/number-guessing-game
The Number Guessing Game is a simple command-line interface (CLI) game where the player tries to guess a randomly selected number between 1 and 100. The game offers different difficulty levels and provides feedback on each guess.
- Random number generation between 1 and 100.
- Three difficulty levels: Easy (10 attempts), Medium (7 attempts), Hard (5 attempts).
- Feedback on whether the guess is higher or lower than the target number.
- Option to play multiple rounds.
- Tracks the number of attempts taken to guess the number.
- Run the program.
- Select the difficulty level.
- Enter your guesses.
- Receive feedback on each guess.
- Continue guessing until you find the correct number or run out of attempts.
- Optionally, play another round.
- Timer: Measures the time taken to guess the number.
- Hint System: Provides clues if the player is stuck.
- High Score Tracking: Records the fewest attempts taken to guess the number for each difficulty level.
- Java Development Kit (JDK) installed on your machine.
- A command-line interface (CLI) to run the program.
- Clone the repository:
git clone https://github.com/lakshay1341/NumberGuessingGame.git
- Navigate to the project directory:
cd NumberGuessingGame
- Compile the Java program:
javac NumberGuessingGame.java
- Run the program:
java NumberGuessingGame
- Follow the on-screen instructions to select the difficulty level.
- Enter your guesses when prompted.
- View feedback and continue guessing until you find the correct number or run out of attempts.
- After each round, decide whether to play again or exit the game.
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License.
Lakshay1341
GitHub: lakshay1341
Thank you for playing the Number Guessing Game! Enjoy coding!