Number Guessing Game, Guess The Number

Guess the Number (0-100)

This is a Number Guessing Game where the objective is to guess a number between 0 and 100. Here’s how it works:

  1. When the game starts, the computer randomly selects a number between 0 and 100. This is the number that the player needs to guess.
  2. The player enters their guess into the input field and clicks the “Guess” button.
  3. The game then checks the player’s guess against the number that the computer has chosen:
    • If the player’s guess is lower than the chosen number, the game displays the message “Too low!” in red.
    • If the player’s guess is higher than the chosen number, the game displays the message “Too high!” in red.
    • If the player’s guess is exactly the same as the chosen number, the game displays the message “Congratulations! You guessed the number in ‘x’ tries!” in green, where ‘x’ is the number of attempts the player made.
  4. The game also keeps track of the number of tries the player has made, and displays this information to the player.
  5. The player continues to make guesses until they guess the correct number.

This game is a fun way to test your number guessing skills. Enjoy playing!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *