You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a simple number guessing game implemented in Python. The program generates a random number between 0 and the user-specified range and challenges the player to guess the correct number.
4
+
5
+
## Getting Started
6
+
7
+
To run the game, you'll need Python 3.x installed on your computer. If you don't have Python installed, you can download it from the official website: [Python.org](https://www.python.org/downloads/).
8
+
9
+
### How to Play
10
+
11
+
1. Clone or download this repository to your local machine.
12
+
2. Open a terminal or command prompt and navigate to the project directory.
13
+
3. Run the `number_guessing_game.py` script using the following command:
14
+
15
+
```bash
16
+
python number_guessing_game.py
17
+
```
18
+
19
+
4. The program will ask you to input a range (a positive integer greater than 0) to generate a random number.
20
+
5. After specifying the range, the program will generate a random number.
21
+
6. You need to make guesses to find the correct number.
22
+
7. The program will provide hints if your guess is above or below the generated number.
23
+
8. Keep guessing until you find the correct number.
24
+
9. The game will display the number of guesses it took to find the correct number.
25
+
26
+
### Example Gameplay
27
+
28
+
```
29
+
Type a number: 100
30
+
Make a guess: 50
31
+
You were below the number!
32
+
Make a guess: 75
33
+
You were below the number!
34
+
Make a guess: 90
35
+
You were above the number!
36
+
Make a guess: 85
37
+
You were below the number!
38
+
Make a guess: 88
39
+
You got it!
40
+
You got it in 5 guesses
41
+
```
42
+
43
+
Feel free to contribute or make suggestions for improvements. Happy coding!
0 commit comments