Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎯 Secret Number Game

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.


📖 About the Project

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.


✨ Features

  • 🎲 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

🛠️ Technologies Used

HTML5 CSS3 JavaScript

Libraries

  • ResponsiveVoice.js

🚀 How to Play

  1. Open the game in your browser.
  2. Enter a number between 1 and 100.
  3. Click the Guess button.
  4. The game will tell you whether the secret number is higher or lower than your guess.
  5. Continue until you find the correct number.
  6. Click New Game to start a new round.

📂 Project Structure

project/
├── img/
│   └── ia.png
├── app.js
├── style.css
├── index.html
└── README.md

🧠 Concepts Practiced

This project helped reinforce:

  • Variables and constants
  • Functions
  • Arrays
  • Recursion
  • Conditional logic
  • DOM manipulation
  • Event-driven programming
  • User interface interaction

🎮 Game Logic

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.


📸 Preview

Secret Number Game


</> Development

📘 Author: Vitor Henrique Morais


✨ Developed as a JavaScript learning project focused on programming logic and web development fundamentals.

About

A web-based Number Guessing Game built with HTML, CSS, and JavaScript. The application generates a random secret number and provides feedback to help players find the correct answer while practicing logical thinking and problem-solving skills.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages