Created
February 8, 2018 20:10
-
-
Save ian-lowe/759cef2ebfb864826da004176ab2e7f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var key = 5; | |
while (Number(guess) !== secretNumber) { | |
var guess = prompt("Guess a number"); | |
if (Number(guess) < secretNumber) { | |
alert("You guessed low. Please guess again!"); | |
} | |
else if (Number(guess) > secretNumber) { | |
alert("You guessed high. Please guess again!"); | |
} | |
else { | |
prompt("You guessed the number correctly!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment