Skip to content

Instantly share code, notes, and snippets.

@mikeadeleke
Created January 26, 2014 01:56
Show Gist options
  • Save mikeadeleke/8626971 to your computer and use it in GitHub Desktop.
Save mikeadeleke/8626971 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
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