Skip to content

The Number Guessing Game is a simple and fun console-based game developed in Java. The objective of the game is for the player to guess a randomly generated number within a specified range.

License

Notifications You must be signed in to change notification settings

lakshay1341/Number_Guessing_Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Number Guessing Game

https://roadmap.sh/projects/number-guessing-game

Overview

The Number Guessing Game is a simple command-line interface (CLI) game where the player tries to guess a randomly selected number between 1 and 100. The game offers different difficulty levels and provides feedback on each guess.

Features

  • Random number generation between 1 and 100.
  • Three difficulty levels: Easy (10 attempts), Medium (7 attempts), Hard (5 attempts).
  • Feedback on whether the guess is higher or lower than the target number.
  • Option to play multiple rounds.
  • Tracks the number of attempts taken to guess the number.

How to Play

  1. Run the program.
  2. Select the difficulty level.
  3. Enter your guesses.
  4. Receive feedback on each guess.
  5. Continue guessing until you find the correct number or run out of attempts.
  6. Optionally, play another round.

Additional Features

  • Timer: Measures the time taken to guess the number.
  • Hint System: Provides clues if the player is stuck.
  • High Score Tracking: Records the fewest attempts taken to guess the number for each difficulty level.

Getting Started

Prerequisites

  • Java Development Kit (JDK) installed on your machine.
  • A command-line interface (CLI) to run the program.

Installation

  1. Clone the repository:
    git clone https://github.com/lakshay1341/NumberGuessingGame.git
  2. Navigate to the project directory:
    cd NumberGuessingGame
  3. Compile the Java program:
    javac NumberGuessingGame.java
  4. Run the program:
    java NumberGuessingGame

Usage

  1. Follow the on-screen instructions to select the difficulty level.
  2. Enter your guesses when prompted.
  3. View feedback and continue guessing until you find the correct number or run out of attempts.
  4. After each round, decide whether to play again or exit the game.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License

This project is licensed under the MIT License.

Contact

Lakshay1341
GitHub: lakshay1341


Thank you for playing the Number Guessing Game! Enjoy coding!

About

The Number Guessing Game is a simple and fun console-based game developed in Java. The objective of the game is for the player to guess a randomly generated number within a specified range.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages