Created
April 20, 2017 23:24
-
-
Save LtAstros/98447eae52d5f7cee448097907837e77 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=98447eae52d5f7cee448097907837e77
This file contains hidden or 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>Page Title</title> | |
</head> | |
<body> | |
<input><button>Submit</button> | |
<div>You guessed:</div><div id="word"></div> | |
<div id="WL"></div> | |
<div id="img"></div> | |
</body> | |
</html> |
This file contains hidden or 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
{"enabledLibraries":["jquery"]} |
This file contains hidden or 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 answer = Math.floor((Math.random() * 10) + 1); | |
$("button").click(function() { | |
var guessString = $("input").val(); | |
var guess = parseInt(guessString); | |
$("#img").html(" "); | |
if (answer === guess) { | |
$("#WL").html("you win"); | |
$("#img").html("<img src = 'https://goo.gl/6CCey3'>"); | |
} else if (guess === 1337) { | |
$("#WL").html("THIS IS SUPER SECRET shhhhh"); | |
} else if (answer > guess) { | |
$("#WL").html("too low :("); | |
} else if (answer < guess) { | |
$("#WL").html("too high :("); | |
} else { | |
$("#WL").html("INPUT IS INVALED ERRROOOOOR ERRRROOOOOR DOES NO COMPUT3#$$#$#%*$#*$#*$#"); | |
} | |
}); |
This file contains hidden or 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
body { | |
background-color: darksalmon; | |
font-family: "comic sans MS"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment