This is a simple game where you have to guess a random number between 1 and 100. You have 10 tries to guess the correct number. The game will give you hints if your guess is high or low.
This game is inspired by the tutorial from Mozilla Developer Network.
To play the game, you need a web browser that supports JavaScript. You can either download the source code from this repository and open the index.html file in your browser, or you can visit the live demo here.
To start the game, click the "Start" button. The game will generate a random number between 1 and 100 and ask you to enter your guess in the input box. You can see how many tries you have left in the paragraph below the input box.
If your guess is correct, you will see a message saying "Congratulations! You got it right!" and the game will end. You can click the "Reset" button to play again.
If your guess is wrong, you will see a message saying "Wrong!" and a hint telling you if your guess was too high or too low. You can try again until you run out of tries or you guess the correct number.
If you run out of tries, you will see a message saying "Game over!" and the game will reveal the correct number. You can click the "Reset" button to play again.
To install the game on your local machine, follow these steps:
- Clone this repository to your desired location using
git clone https://github.com/amit-katyal/guess-the-number-game.git
- Open the index.html file in your web browser.
- Enjoy!
If you want to contribute to this project, please follow these guidelines:
- Fork this repository and create a new branch for your feature or bug fix.
- Write clear and concise commit messages and pull request descriptions.
- Test your code before submitting it.
- Respect the code style and format of the existing code.
- Be polite and respectful to other contributors and users.
This project is licensed under the MIT License - see the LICENSE file for details.