Skip to content

==> Guess the number game with vanilla JavaScript (Built With HTML, CSS, JavaScript)

Notifications You must be signed in to change notification settings

saddamarbaa/guess-the-number-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Guess The Number Game

Guess the number game (Store random number from 1 to 100)

How to play :

==> Guess the number game ask user What's your guess? If the user entered a random number that is bigger than the correct number will say Your guess is too high!. If the user entered a random number that is smaller than the correct number will say Your guess is too low!. If the user entered the correct number will say Awesome job, you got it!. It allows the user to reset the game at any time they wanted. (Built with HTML, CSS, JavaScript)

When the user guess is smaller than correct number

image

When the user guess is bigger than correct number

image

When the user guessed the correct number

image

DONE

DONE : Get user value from input and save it to variable numberGuess

DONE : Generate a random number 1 to 100 and save it to variable correctNumber

DONE : Console whether the guess is too high, too low, or is correct inside playGame function

DONE : Create a function called displayResult to move the logic for if the guess is too high, too low, or correct

DONE : Complete the showYouWon, showNumberAbove, showNumberBelow

DONE : Use the showYouWon... functions within displayResult to display the correct dialog

DONE : Save the guess history in a variable called guess

DONE : Display the guess history using displayHistory() function

DONE : Use the initGame() function to restart the game

TODO

TODO : Improve the code efficiency as much as possible