A simple and interactive number guessing game developed with HTML, CSS, and JavaScript.
The goal of the game is to guess a randomly generated secret number between 1 and 100. Players receive hints after each attempt, helping them discover the correct number in the fewest guesses possible.
This project was created to practice fundamental web development concepts, including:
- DOM manipulation
- JavaScript functions
- Conditional statements
- Random number generation
- Event handling
- User interaction
Additionally, the game includes voice feedback using the ResponsiveVoice library, making the experience more interactive and accessible.
- 🎲 Random secret number generation
- 🔄 Prevention of repeated secret numbers until all possibilities are used
- 📢 Voice narration for messages and instructions
- 📈 Attempt counter
- 💡 Hints indicating whether the secret number is higher or lower
- 🔁 New Game functionality
- 📱 Responsive interface
- ResponsiveVoice.js
- Open the game in your browser.
- Enter a number between 1 and 100.
- Click the Guess button.
- The game will tell you whether the secret number is higher or lower than your guess.
- Continue until you find the correct number.
- Click New Game to start a new round.
project/
├── img/
│ └── ia.png
├── app.js
├── style.css
├── index.html
└── README.md
This project helped reinforce:
- Variables and constants
- Functions
- Arrays
- Recursion
- Conditional logic
- DOM manipulation
- Event-driven programming
- User interface interaction
The game generates a random secret number between 1 and 100.
After each guess:
- If the number is correct, the player wins.
- If the guess is too high, a message indicates that the secret number is lower.
- If the guess is too low, a message indicates that the secret number is higher.
The system also tracks the number of attempts and displays it when the player wins.
📘 Author: Vitor Henrique Morais
✨ Developed as a JavaScript learning project focused on programming logic and web development fundamentals.
