/number-guessing-game

This is a simple number guessing game implemented in C++. The program generates a random number between 1 and 100, and the player needs to guess the correct number.

Primary LanguageC++MIT LicenseMIT

Number Guessing Game

This is a simple number guessing game implemented in C++. The program generates a random number between 1 and 100, and the player needs to guess the correct number.

How to Play

  1. Run the program.
  2. The program will generate a random number between 1 and 100.
  3. Enter your guess and press Enter.
  4. The program will provide feedback if your guess is too high or too low.
  5. Keep guessing until you correctly guess the number.
  6. The program will display the number of tries it took to guess the correct number.
  7. Enjoy the game!

Getting Started

To run the game on your local machine, follow these steps:

  1. Ensure you have a C++ compiler installed.
  2. Clone this repository or download the source code file.
  3. Compile the source code using your C++ compiler.
  4. Run the compiled executable.
  5. Play the game!

Example Usage

Enter your guess (1-100): 50
Too high! Try again.
Enter your guess (1-100): 25
Too low! Try again.
Enter your guess (1-100): 37
Congratulations! You guessed the number in 3 tries.

Contributing

Contributions to the project are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.