RahimGuerfi / Guess_the_number

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Number Guesser Game

Welcome to the Number Guesser game! This simple JavaScript game lets you guess a random number between 0 and 9 and see if you can beat the computer.

How to Play

  1. Input a Number: Start by inputting a number between 0 and 9 in the input field provided for you.

  2. Make a Guess: Click the "Make a Guess" button to submit your guess. The computer will also make a guess.

  3. See Who Wins: The game will determine whether you or the computer is closer to the target number. If you win, you'll see a "You Win!" message; otherwise, the computer wins.

  4. Next Round: Click the "Next Round" button to play another round.

Features

  • Random Target Number: A random target number between 0 and 9 is generated for each round.
  • Scorekeeping: Your score and the computer's score are displayed, and they are updated after each round.
  • Input Validation: The game ensures that you input a valid number between 0 and 9.
  • Number Controls: You can increment or decrement your guess using the "+" and "-" buttons.
  • Styling: The game has a clean and user-friendly interface with CSS styling.

JavaScript Code

You can find the JavaScript code for the game in script.js. This code handles the game logic, including generating the target number, comparing guesses, and updating the scores.

CSS Styling

The CSS styling for the game is defined in style.css. It ensures that the game looks visually appealing and is easy to use.

HTML Structure

The HTML structure for the game is defined in index.html. It sets up the layout and elements required for the game.

How to Run

To play the game, simply open index.html in your web browser. Make sure you have an internet connection since it references external fonts via Google Fonts.

Enjoy playing the Number Guesser game and have fun guessing those numbers!


Good luck with your Number Guesser game! Screenshot 2023-09-18 at 10 48 30 PM

About


Languages

Language:JavaScript 45.8%Language:CSS 30.6%Language:HTML 23.6%