https://github.com/samyam81/guessnum
Guess the number.
https://github.com/samyam81/guessnum
class cli gui java
Last synced: over 1 year ago
JSON representation
Guess the number.
- Host: GitHub
- URL: https://github.com/samyam81/guessnum
- Owner: samyam81
- Created: 2024-02-07T07:06:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-21T07:32:37.000Z (about 2 years ago)
- Last Synced: 2025-01-27T09:14:25.802Z (over 1 year ago)
- Topics: class, cli, gui, java
- Language: Java
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Guess-The-Num
This repository contains two implementations of a "Guess-The-Num" game: one in console mode and the other in GUI mode using Java Swing.
## Console Version (`guess` Class)
- The `guess` class implements the console version of the game.
- It generates a random number between 0 and 9 and prompts the user to guess the number.
- The user has three lives to guess the correct number.
- After each guess, the program provides hints to help the user guess the number.
- Once the user runs out of lives, the game reveals the correct answer.
## GUI Version (`guessnum` Class)
- The `guessnum` class implements the GUI version of the game using Java Swing.
- It provides a graphical interface for the user to input their guesses.
- The interface displays the number of lives remaining and provides feedback on each guess.
- The game continues until the user either guesses the correct number or runs out of lives.
- Once the game ends, the GUI displays the correct answer.
### How to Play
- Run the `guess` class for the console version or the `guessnum` class for the GUI version.
- Follow the prompts to input your guesses.
- In the GUI version, click the number buttons to input your guess.
- Pay attention to the feedback provided after each guess.
- Try to guess the correct number within the given number of lives.
Enjoy playing "Guess-The-Num" in both console and GUI modes!