Skip to content

A simple Java-based number guessing game where the user guesses a randomly generated number within a specified range. Includes error handling and user-friendly prompts to guide the player.

License

Notifications You must be signed in to change notification settings

nurulashraf/java-number-guessing-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Java Number Guessing Game

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.

Features

  • Random number generation within a predefined range.
  • User-friendly prompts and feedback.
  • Error handling for invalid inputs.
  • Keeps track of the number of attempts.

Prerequisites

  • Java Development Kit (JDK) 8 or higher.

Installation

  1. Clone the repository:
    git clone https://github.com/nurulashraf/java-number-guessing-game.git
  2. Navigate to the project directory:
    cd java-number-guessing-game
  3. Compile the Java file:
    javac src/NumberGuessingGame/NumberGuessingGame.java
  4. Run the game:
    java -cp src NumberGuessingGame.NumberGuessingGame

Usage

  • 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.

Repository Structure

java-number-guessing-game/
│── src/
│   ├── NumberGuessingGame.java
│── README.md
│── LICENSE

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A simple Java-based number guessing game where the user guesses a randomly generated number within a specified range. Includes error handling and user-friendly prompts to guide the player.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages