Skip to content

BHUVANESWAR-G/javascript_project4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐ŸŽฏ Guess the Number Game

A simple and interactive number guessing game built using HTML and JavaScript. The player has to guess a randomly generated number between 1 and 10.


๐Ÿ“Œ Project Overview

This is a beginner-friendly web project where:

  • A random number is generated between 1โ€“10
  • The user inputs a number
  • The system checks whether the guess is correct or not
  • The score decreases for every wrong attempt

๐Ÿš€ Features

  • ๐Ÿ”ข Random number generation (1โ€“10)
  • ๐ŸŽฏ User input validation
  • ๐Ÿ“‰ Score tracking system
  • โŒ Wrong guess feedback
  • ๐ŸŽ‰ Winning alert message

๐Ÿ› ๏ธ Technologies Used

  • HTML5
  • JavaScript (Vanilla JS)

๐Ÿ“‚ Project Structure

Guess-The-Number/
โ”‚โ”€โ”€ index.html   # Main game file

โ–ถ๏ธ How to Run the Project

  1. Download or clone the repository
  2. Open the index.html file in any web browser
  3. Enter a number between 1 and 10
  4. Click Check to see the result

๐ŸŽฎ How It Works

  • The game generates a random number using:

    Math.floor(Math.random() * 10 + 1)
  • Player starts with a score of 10

  • Each wrong guess reduces the score by 1

  • Game continues until the correct number is guessed


๐Ÿ“ธ Sample Gameplay

  • Input a number โ†’ Click Check
  • If correct โ†’ ๐ŸŽ‰ "You are Right!"
  • If wrong โ†’ โŒ Score decreases

๐Ÿ’ก Future Improvements

  • Add restart/reset button
  • Limit number of attempts
  • Provide hints (higher/lower)
  • Improve UI with CSS styling

About

Simple number guessing game using HTML & JavaScript with score tracking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages