A fun command-line number guessing game built in Python โ made after just 1 hour of learning! ๐
Howdy! This is a Number Guessing Game created as a beginner Python project. The computer randomly picks a number between 1 and 5 and you get one shot to guess it. Guess right and you win โ guess wrong and a new number is picked for another round! ๐
| Feature | Description |
|---|---|
| ๐ฒ Random Number Generation | A new secret number (1โ5) is picked every round |
| โก Single-Guess Rounds | One guess per round โ beat the odds! |
| ๐ Replay Support | Type y or yes after winning to play again |
| ๐ต๏ธ Number Reveal | If you miss, the correct number is shown so you always learn |
- Python 3.6+ installed on your machine. Download it from python.org.
# Clone this repository
git clone https://github.com/adett2013/python-NumberGuessGame.git
# Navigate into the project directory
cd python-NumberGuessGamepython main.py- Run the script using the command above.
- The program picks a random number between 1 and 5.
- Type your guess (a number from 1 to 5) and press Enter.
- Two outcomes are possible:
- ๐ Correct! โ The number is revealed and you're asked if you want to play again.
- โ Wrong! โ The correct number is revealed, and a fresh round starts automatically.
- After a correct guess, type
yoryesto play again, or anything else to quit.
Winning round:
Welcome to the number guessing game! You have to guess the random number between 1-5. Lets go!
Type your guess! 3
You've guessed the correct number! Number: 3
Type y to play again. Type n to quit. y
Type your guess!
Losing round:
Welcome to the number guessing game! You have to guess the random number between 1-5. Lets go!
Type your guess! 2
The random number was 4
Try again. Note: The number has changed after your guess.
Type your guess!
Quitting:
Type y to play again. Type n to quit. n
Thanks for playing my game. This means a lot to me!
Find more games on https://www.arne-dettmer.de
Contributions, issues, and feature requests are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.
Made with โค๏ธ and Python ยท Happy Guessing! ๐ฏ
Find more games on arne-dettmer.de