Created
January 26, 2014 01:56
-
-
Save mikeadeleke/8626971 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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()*11); | |
var x = prompt("Pick a number between 1 and 10."); | |
var number = function(x) { | |
if (randomnumber == x) | |
alert("Amazing! Are you cheating ;)"); | |
else if (randomnumber > x) | |
alert("Too hot!"); | |
else if (randomnumber < x) | |
alert("Too cold!"); | |
else | |
alert("Please enter a number between 1 and 10."); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment