Skip to content

Anchalvishwa/Guess-number-JAVA-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Guess the Number

Welcome to the "Guess the Number" project! This is a simple Java-based game where the computer generates a random number, and the player attempts to guess it. The game provides feedback on each guess and continues until the player guesses correctly.

Features

  • Random Number Generation: The computer selects a random number within a specified range.
  • User Input: The player inputs guesses via the command line.
  • Feedback: The game informs the player if their guess is too high, too low, or correct.
  • Replayability: Players can restart the game after a successful guess or game over.

Getting Started

Prerequisites

  • Java Development Kit (JDK) 8 or later
  • A Java Integrated Development Environment (IDE) such as IntelliJ IDEA, Eclipse, or any text editor with command line access

Installation

  1. Clone the Repository:

    git clone https://github.com/yourusername/guess-the-number.git
  2. Navigate to the Project Directory:

    cd Guess-number-JAVA
  3. Compile the Code:

    javac Guess-number-JAVA.java
  4. Run the Application:

    java Guess-number-JAVA

How to Play

  1. Start the Game: Run the Guess-number-JAVA class.
  2. Make a Guess: Enter your guess when prompted.
  3. Receive Feedback: The game will tell you if your guess is too high, too low, or correct.
  4. Guess Again: Continue guessing until you find the correct number.
  5. Play Again: Once you guess the number correctly, you can choose to play again or exit.

Code Overview

  • Guess-number-JAVA.java: Contains the main logic of the game, including random number generation, user input handling, and game flow control.

Example

Here is an example of how the game might interact with a player:

Welcome to Guess the Number!
I'm thinking of a number between 1 and 100.
Enter your guess:

50
Your guess is too high. Try again:

25
Your guess is too low. Try again:

37
Congratulations! You've guessed the number!
Would you like to play again? (yes/no)

Contributing

Feel free to open issues or submit pull requests if you have suggestions for improvements or new features. Contributions are welcome!

Contact

For any questions or feedback, you can reach me at [anchalvishwa28@gmail.com).


Thank you for checking out my project. Have fun guessing!


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages