A simple interactive number guessing game built with vanilla JavaScript where players try to guess a randomly generated number between 1 and 20.
- Random number generation between 1-20
- Score tracking system (starts at 20)
- Highscore tracking
- Interactive feedback ("Too high!" or "Too low!")
- Visual feedback with color changes
- Reset game functionality
- Enter a number between 1 and 20 in the input field
- Click the "Check!" button to make a guess
- Follow the hints to guess the correct number
- Try to maintain the highest score possible
- Beat your highscore!
- HTML5
- CSS3
- JavaScript (ES6+)
- Clone the repository:
git clone https://github.com/codeplaygroundspace/guess-my-number-js.git
- Open
index.html
in your preferred browser
- Starting score is 20
- Each wrong guess deducts 1 point
- Game over when score reaches 0
- Highscore is saved across game sessions
- Use the "Again!" button to reset the game
- Responsive design
- Dynamic UI updates
- Score tracking
- Highscore persistence
- Input validation
- Visual feedback for correct/incorrect guesses
Feel free to fork this project and submit pull requests. You can also open issues for any bugs found or improvements suggested.
This project is open source and available under the MIT License.