|
| 1 | +# Guess the Number Game - README |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +Welcome to the "Guess the Number" game! This Python script allows you to play a simple guessing game where you have to guess a randomly chosen number between 1 and 100. The game will provide you with feedback for each guess you make, helping you determine whether your guess is too low or too high. |
| 6 | + |
| 7 | +## How to Play |
| 8 | + |
| 9 | +1. **Launch the Game**: Run the Python script (guess_the_number.py) in your preferred Python environment. |
| 10 | +2. **Game Rules**: The computer will randomly select a secret number between 1 and 100, which you have to guess. |
| 11 | +3. **Making a Guess**: You will be prompted to enter your guess. Input an integer between 1 and 100 and press Enter. |
| 12 | +4. **Feedback**: After each guess, the game will provide feedback to help you adjust your next guess: |
| 13 | + - If your guess is correct, you will receive a congratulatory message along with the number of attempts it took you to guess correctly. |
| 14 | + - If your guess is too low, the game will inform you to try a higher number. |
| 15 | + - If your guess is too high, the game will suggest trying a lower number. |
| 16 | +5. **Invalid Input Handling**: If you input anything other than a valid integer, the game will notify you and prompt for a new guess. |
| 17 | +6. **Keep Guessing**: Continue making guesses until you correctly guess the secret number. |
| 18 | + |
| 19 | +## Example |
| 20 | + |
| 21 | +``` |
| 22 | +Welcome to Guess the Number Game! |
| 23 | +I'm thinking of a number between 1 and 100. |
| 24 | +Enter your guess: 50 |
| 25 | +Too low! Try again. |
| 26 | +Enter your guess: 75 |
| 27 | +Too high! Try again. |
| 28 | +Enter your guess: 65 |
| 29 | +Too high! Try again. |
| 30 | +Enter your guess: 60 |
| 31 | +Too low! Try again. |
| 32 | +Enter your guess: 62 |
| 33 | +Congratulations! You guessed the number in 5 attempts. |
| 34 | +``` |
| 35 | + |
| 36 | +## Requirements |
| 37 | + |
| 38 | +This game is written in Python and requires no external libraries. You can run it using any Python 3.x interpreter. |
| 39 | + |
| 40 | +## Contribution |
| 41 | + |
| 42 | +If you have any ideas or suggestions to enhance the game or improve the code, feel free to contribute! Fork the repository, make your changes, and create a pull request. |
| 43 | + |
| 44 | +## License |
| 45 | + |
| 46 | +This project is licensed under the [MIT License](LICENSE). |
| 47 | + |
| 48 | +## Contact |
| 49 | + |
| 50 | +For any questions or feedback, please contact: |
| 51 | + |
| 52 | +Shivansh Jain |
| 53 | + |
0 commit comments