A simple Java-based number guessing game where the user attempts to guess a randomly generated number within a specified range. The program provides feedback on whether the guess is too high or too low until the correct number is guessed. Includes error handling for invalid inputs.
- Random number generation within a predefined range.
- User-friendly prompts and feedback.
- Error handling for invalid inputs.
- Keeps track of the number of attempts.
- Java Development Kit (JDK) 8 or higher.
- Clone the repository:
git clone https://github.com/nurulashraf/java-number-guessing-game.git
- Navigate to the project directory:
cd java-number-guessing-game
- Compile the Java file:
javac src/NumberGuessingGame/NumberGuessingGame.java
- Run the game:
java -cp src NumberGuessingGame.NumberGuessingGame
- Run the program and follow the on-screen instructions to guess the number.
- Enter a number within the given range.
- The game will provide hints if your guess is too high or too low.
- Continue guessing until you find the correct number.
java-number-guessing-game/
│── src/
│ ├── NumberGuessingGame.java
│── README.md
│── LICENSE
This project is licensed under the MIT License. See the LICENSE file for details.