Skip to content

Instantly share code, notes, and snippets.

@javedbaloch4
Last active May 8, 2016 18:26
Show Gist options
  • Save javedbaloch4/bd1deecbf142d7f23014b399ea7b46d7 to your computer and use it in GitHub Desktop.
Save javedbaloch4/bd1deecbf142d7f23014b399ea7b46d7 to your computer and use it in GitHub Desktop.
<!-- This game created by Javed Baloch, 8-May-2016--->
<html>
<head>
<title>How Many Fingers</title>
<style type="text/css">
</style>
</head>
<body>
<p>How Many Finder I am holding Up!</p>
<p><input type="text" id="numberBox"> <button id="check">Guess!</button></p>
<script type="text/javascript">
document.getElementById("check").onclick = function() {
var EnteredNumber = Math.random();
EnteredNumber = EnteredNumber * 6;
EnteredNumber = Math.floor(EnteredNumber);
if(document.getElementById("numberBox").value == EnteredNumber) {
alert("Well done! You got it!");
} else {
alert("Note! The number was " + EnteredNumber);
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment