This repository contains a simple yet fun Python-based game called "Guess the Number." The game challenges players to guess a randomly generated number within a specified range. It's a great example of basic programming concepts such as loops, conditionals, and user input handling in Python.
- Random Number Generation: The game generates a random number within a defined range.
- User Interaction: Players input their guesses and receive feedback on whether their guess is too high, too low, or correct.
- Input Validation: The game checks for invalid inputs and prompts the user to enter a valid number.
- Replay Option: After guessing the number, players can choose to play again or exit the game.
To run the game locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/yourusername/guess-the-number.git
-
Navigate to the Project Directory:
cd guess-the-number
-
Run the Game:
python guess_the_number.py
The game logic is implemented in guess_the_number.py
, which includes:
- Number generation and range setting.
- Game loop for handling user input and game progression.
- Feedback mechanism to guide the player.