Created
September 15, 2014 16:57
-
-
Save alacritythief/b5ea3c3fe2362442b4a6 to your computer and use it in GitHub Desktop.
Guess the Number
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 randomNumber = Math.floor(Math.random()*101); | |
var userName = prompt("What is your name?"); | |
var guess = prompt("Please guess a number 1 - 100:"); | |
if (guess == randomNumber) { | |
alert(userName + ", you guessed correctly! You win!"); | |
} else { | |
alert(userName + ", that is the wrong number! You lose!"); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Guess the Number</title> | |
</head> | |
<body> | |
<script src="guess_the_number.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment