Last active
August 29, 2015 14:20
-
-
Save BrennaBlackwell/27e3e81b2a7ee2b5c9f0 to your computer and use it in GitHub Desktop.
Dragon Adventure Game for 100 Girls of Code
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>My Own Adventure Game</title> | |
</head> | |
<body> | |
<h1>My Adventure Game!</h1> | |
<script language="Javascript"> | |
var adventurer = window.prompt("What is your name, adventurer?") | |
document.write("<p>Welcome, " + adventurer + "!</p>") | |
var fightDragon = window.prompt("Do you want to fight a dragon?") | |
fightDragon = fightDragon.toLowerCase() | |
if (fightDragon == 'yes') { | |
document.write("<p>You have defeated the dragon!</p>") | |
} else if (fightDragon == 'no') { | |
document.write("<p>You have a tea party with the dragon!</p>") | |
} else { | |
document.write("<p>The dragon doesn't know what you're doing, so it took a nap</p>") | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment