iamvbenz49 / guess-the-number

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guess the Number Game

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.

Game Rules

  1. The game generates a random number between a specified minimum and maximum range (inclusive).
  2. The player needs to enter their guess in the input field and submit it.
  3. After each guess, the game provides feedback to the player, indicating whether their guess was too low or too high.
  4. The player continues guessing until they correctly guess the random number.
  5. Once the correct number is guessed, the game displays a congratulatory message with the number of attempts made.
  6. The player can then choose to play again and start a new game with a new random number.

Play the Game

You can play the game online by following this link.

Files

The project contains the following files:

  1. index.html: This file contains the HTML structure of the game interface, including the input field, submit button, and result display area.
  2. style.css: This file contains the CSS styles to visually enhance the game interface.
  3. script.js: This file contains the JavaScript code that implements the game logic, including generating random numbers, validating guesses, and providing feedback.

Getting Started

To run the game locally, follow these steps:

  1. Download or clone the repository to your local machine.
  2. Open the index.html file in a web browser.
  3. The game interface will be displayed, and you can start playing by entering your guesses in the input field and submitting them.

Customization

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.

Acknowledgments

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.

About


Languages

Language:CSS 52.9%Language:HTML 25.8%Language:JavaScript 21.3%