Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Number Guessing Game

Guess a random number (1-100) with 5 attempts per round. Get hints after each wrong guess. Choose to continue if you fail. Total attempts tracked across rounds.

Run

cd number-guessing-game
javac src/App.java
java -cp src App

Sample Input/Output

I'm thinking of a number between 1 and 100.
Can you find it within 5 tries?
Take a guess: 50
Try a number greater than 50
Take a guess: 75
Try a number greater than 75
Take a guess: 88
Try a number greater than 88
Take a guess: 94
Try a number greater than 94
Take a guess: 97
Try a number less than 97
Sorry, you've used all 5 attempts.
Want another chance? (yes/no): yes
Take a guess: 96
Amazing! You got it right in 6 tries!