This is a simple web-based game called "Guess the Number." The game allows players to guess a randomly generated number within a specified range. It is implemented using HTML, CSS, and JavaScript.
- The game generates a random number between a specified minimum and maximum range (inclusive).
- The player needs to enter their guess in the input field and submit it.
- After each guess, the game provides feedback to the player, indicating whether their guess was too low or too high.
- The player continues guessing until they correctly guess the random number.
- Once the correct number is guessed, the game displays a congratulatory message with the number of attempts made.
- The player can then choose to play again and start a new game with a new random number.
You can play the game online by following this link.
The project contains the following files:
index.html
: This file contains the HTML structure of the game interface, including the input field, submit button, and result display area.style.css
: This file contains the CSS styles to visually enhance the game interface.script.js
: This file contains the JavaScript code that implements the game logic, including generating random numbers, validating guesses, and providing feedback.
To run the game locally, follow these steps:
- Download or clone the repository to your local machine.
- Open the
index.html
file in a web browser. - The game interface will be displayed, and you can start playing by entering your guesses in the input field and submitting them.
You can customize the game by modifying the following variables in the script.js
file:
minRange
: The minimum number in the range of the random number generation.maxRange
: The maximum number in the range of the random number generation.
You can also modify the CSS styles in the style.css
file to change the appearance of the game interface according to your preferences.
The game was developed using HTML, CSS, and JavaScript with the help of online resources and tutorials. Credits and references to the original sources can be found within the code comments.