22
33Number Guessing is a CLI game where the computer randomly selects a number
44and the user has to guess it. The user is given a limited number of chances to guess the number.
5- If the user guesses the number correctly, the game ens , and the user wins. Otherwise,
5+ If the user guesses the number correctly, the game ends , and the user wins. Otherwise,
66the game continues until the user runs out of chances.
7- </br >
8- </br >
7+
98This is a learning project built in Go as part of [ roadmap.sh] ( https://roadmap.sh/projects/number-guessing-game ) challenge.
109
1110## Features
1211
13- - Multiple Difficulty levels (easy, medium, hard)
14- - Input Validation
12+ - Multiple difficulty levels (easy, medium, hard)
13+ - Input validation
14+ - Multiple rounds support
1515
1616## Requirements
1717
@@ -31,7 +31,7 @@ go build
3131``` bash
3232./Number-Guessing
3333```
34- ### Sample Output
34+ ### Sample Output 1 - Single Round
3535``` text
3636Welcome to Number Guessing Game!
3737I'm thinking of a number between 1 and 100.
@@ -63,6 +63,61 @@ Incorrect! The number is less than 85
6363Enter your guess: 87
6464Game Over! You have used all the attempts
6565```
66+ ### Sample Output 2 - Multiple Rounds
67+ ``` text
68+ Welcome to Number Guessing Game!
69+ I'm thinking of a number between 1 and 100.
70+ You have limited number of chances to guess the correct number depending upon the difficulty level.
71+
72+ Please select the difficulty level.
73+ 1. Easy (10)
74+ 2. Medium (5)
75+ 3. Hard (3)
76+
77+ Enter your choice: 2
78+
79+ Great! You have selected the Medium level.
80+ Let's start the game!
81+
82+
83+ Enter your guess: 60
84+ Incorrect! The number is greater than 60
85+
86+ Enter your guess: 71
87+ Incorrect! The number is less than 71
88+
89+ Enter your guess: 69
90+ Incorrect! The number is less than 69
91+
92+ Enter your guess: 67
93+ Incorrect! The number is less than 67
94+
95+ Enter your guess: 64
96+ Congratulations! You guessed the correct number in 5 attempts
97+
98+ Would you like to play again? (Y/n): Y
99+ Please select the difficulty level.
100+ 1. Easy (10)
101+ 2. Medium (5)
102+ 3. Hard (3)
103+
104+ Enter your choice: 3
105+
106+ Great! You have selected the Hard level.
107+ Let's start the game!
108+
109+
110+ Enter your guess: 75
111+ Incorrect! The number is less than 75
112+
113+ Enter your guess: 38
114+ Incorrect! The number is greater than 38
115+
116+ Enter your guess: 49
117+ Game Over! You have used all the attempts
118+
119+ Would you like to play again? (Y/n): n
120+ ```
66121
67122## License
68123
0 commit comments