Skip to content

ayushie18/code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Java Number Guessing Game

This is a simple console-based number guessing game implemented in Java, demonstrating basic OOP (Object-Oriented Programming) principles with separate classes for the Guessor, Players, and the Umpire.

๐Ÿš€ How the Game Works

The game follows a simple, structured process:

  1. The Guessor secretly inputs a number.
  2. Up to four Players then input their guesses.
  3. The Umpire collects all inputs and compares the players' guesses against the Guessor's number, announcing all winners.

๐Ÿ“ Project Structure (OOP)

The project is divided into four files to ensure high readability and maintain separation of concerns:

Class File Responsibility
GuessorGame.java Contains the main method. Initializes the game and coordinates the process.
Umpire.java Manages the game flow. Collects the numbers and performs the comparison logic.
Guessor.java Handles the input for the secret number.
Player.java Handles the input for a single player's guess.

โ–ถ๏ธ How to Run the Project

Using Command Line

  1. Navigate to the project's source directory (the folder containing the .java files).
  2. Compile all files:
    javac *.java
  3. Execute the main class:
    java GuessorGame

Using IntelliJ IDEA

  1. Open the project in IntelliJ.
  2. Open the GuessorGame.java file.
  3. Click the green run button next to the main method definition.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages