Skip to content

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Guess The Number β€” Java Number Game

Java Console Game Status License

A fun and interactive Number Guessing Game built in Java. The user tries to guess a random number generated by the computer within a limited range and receives feedback (higher/lower) on guesses until the correct number is found.

This project demonstrates basic programming concepts such as loops, conditional logic, random numbers, and user input handling using the Scanner class.


🧠 Project Overview

The game works as follows :

  1. A random number is generated between 1 and 100.
  2. The player enters their guess.
  3. The program tells the player if their guess is too low, too high, or correct.
  4. The player keeps guessing until the number is found.
  5. The game ends when the correct number is guessed.

πŸ“ Project Structure

Number-Game/ β”œβ”€β”€ GuessTheNumber.java └── README.md


πŸ›  Tech Stack

  • πŸ”Ή Java
  • πŸ”Ή Scanner (for user input)
  • πŸ”Ή Random number generation
  • πŸ”Ή Loops and conditional logic

πŸš€ How It Work

The program:

  • Generates a random integer
  • Takes user input from the console
  • Compares input with the random number
  • Provides helpful hints (β€œToo high”, β€œToo low”)
  • Continues until the correct guess

This simple game makes learning logic fun while demonstrating key fundamentals of programming.


▢️ How to Run

1️⃣ Clone the repository

git clone https://github.com/shreyadesai20042009/Number-Game.git
cd Number-Game
2️⃣ Compile the Java file
javac GuessTheNumber.java
3️⃣ Run the game
java GuessTheNumber
πŸ•Ή Gameplay Example
Welcome to Guess The Number!
Guess a number between 1 and 100:
> 58
Too low! Try again.
> 87
Too high! Try again.
> 75
Correct! πŸŽ‰
Congratulations, you guessed the number in 4 attempts!
πŸ“Œ Learning Outcomes

By completing this project, you will learn :

Handling user input

Using loops effectively

Applying random number generation

Conditional (if/else) logic

Basic console interactivity

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages