Skip to content

shahmeer-codes/Java-Number-Guessing-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎮 Java Guess The Number

A simple console-based number guessing game built using Java.

Features

  • Random number generation (1–100)
  • Unlimited guesses
  • Input validation
  • Attempt counter
  • Exit anytime using -1
  • Beginner-friendly Java project

Technologies

  • Java
  • Scanner
  • Math.random()

Project Structure

src/
└── Main.java

How to Run

  1. Clone the repository
git clone https://github.com/your-username/Java-Guess-The-Number.git
  1. Open the project in your favorite Java IDE.

  2. Compile and run:

javac Main.java
java Main

Gameplay

Guess The Number Game

Guess a number between 1 and 100

Enter your guess: 50

Too high!

Enter your guess: 25

Too low!

Enter your guess: 36

Congratulations!
You guessed the correct number.
Attempts: 3

Future Improvements

  • Difficulty levels
  • Scoreboard
  • Timer
  • High score system
  • Multiple rounds
  • Play Again option

Author

Shahmeer Rana

GitHub: https://github.com/shahmeer-codes

About

A simple Java console game where players guess a randomly generated number between 1 and 100. Includes input validation, attempt tracking, and interactive gameplay.

Topics

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages