number_guessing_game-by-rehman v1.0.1
Guess Number Game BY REHMAN
Guess Number Game is a command-line game that challenges your ability to guess a random number generated by the computer. It's a fun and simple game that can provide hours of entertainment. Try your luck and see if you can guess the correct number!
Features
Random Number Generation: The game generates a random number between 0 and 10, and your goal is to guess that number.
Multiple Rounds: You can choose the number of rounds you want to play. The game allows you to select either 3 or 5 rounds.
Interactive: The game interacts with you through a user-friendly command-line interface.
Winning: If you guess the correct number, you win the round and receive a congratulatory message.
Losing: If you don't guess the correct number in the allowed number of rounds, you'll be encouraged to try again later.
Installation
Make sure you have Node.js installed on your computer.
Clone this repository or download the source code.
Open your terminal or command prompt and navigate to the project directory.
Install the necessary dependencies using npm:
npm install
Usage
Run the game with the following command:
node guess-number-game.js
The game will start by greeting you and asking how many rounds you want to play (3 or 5 rounds).
In each round, the game will prompt you to guess a number between 0 and 10.
If you guess the correct number, you will receive a winning message and be informed about the generated number.
If you don't guess the correct number within the allowed number of rounds, you'll be encouraged to try again later.
You can run the game as many times as you like for more chances to win.
Example
Here's an example of playing a 3-round game:
Game Guess Number is starting!
Choose the total rounds:
1. 3
2. 5
? Choose the total rounds 3
round : 1
Guess a number between 0 and 10
? Enter a number 5
You are lower than the computer-generated number
Try Again
round : 2
Guess a number between 0 and 10
? Enter a number 8
You are higher than the computer-generated number
Try Again
round : 3
Guess a number between 0 and 10
? Enter a number 7
Congratulation! You are correct
The computer-generated number was 7
You Won, You can claim your reward
Author
The Guess Number Game program was developed by Abdul Rehman.
License
This program is made available under the Abdulrehman license.