Skip to content

Repository files navigation

Number Guessing Game 🎮

A simple, classic number guessing game built with HTML, CSS, and JavaScript. The objective is to guess a secret number chosen by the computer within a limited number of attempts.

This project demonstrates basic web development concepts including DOM manipulation, event handling, and simple game logic.

Play the live version here!https://amirulsizan.github.io/numguess/

Features

  • Randomly generated secret number within a defined range (1-50).
  • User input for guesses.
  • Feedback provided for each guess ("Too high!", "Too low!").
  • Limited number of attempts (7 guesses).
  • Clear win/loss messages upon game completion.
  • A "Play Again" button to restart the game easily.
  • Basic input validation.
  • Responsive layout (basic).

Screenshot

Alt text

How to Play (Live Version)

  1. Click the Live Demo link provided above.
  2. The game will tell you the range the secret number falls within and how many attempts you have.
  3. Enter your numerical guess into the input box.
  4. Click the "Guess" button or press the Enter key.
  5. Read the feedback provided.
  6. Continue guessing based on the feedback until you guess the number correctly or run out of attempts.
  7. If you want to play again, click the "Play Again?" button.

Running Locally

If you want to run the game on your local machine:

  1. Clone the repository:
    git clone [https://amirulsizan.github.io/numguess/](https://amirulsizan.github.io/numguess/)
    
  2. Navigate to the directory:
    cd numguess
  3. Open the index.html file in your preferred web browser (e.g., Chrome, Firefox, Edge).

Technologies Used

  • HTML5: For the structure and content of the web page.
  • CSS3: For styling the user interface.
  • JavaScript (ES6+): For game logic, DOM manipulation, and event handling.

Future Improvements (Ideas)

  • Add difficulty levels (e.g., Easy: 1-25, Medium: 1-50, Hard: 1-100 with fewer guesses).
  • Track high scores or fewest guesses using local storage.
  • Improve UI/UX with better styling or animations.
  • Add hints after a certain number of incorrect guesses.

License

This project is open source and available under the MIT License.


This README was generated based on project details as of Thursday, May 1, 2025.

About

Simple Number Guessing Game

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages