-
-
Save vanleuven/980b157d45258bc1c3e4 to your computer and use it in GitHub Desktop.
Guessing Game assignment November 2, 2015
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 question1 = prompt("Did you grow up in Seattle?"); | |
question1 = question1.toLowerCase(); | |
console.log("Response 1: " + question1); | |
if (question1 === "yes" || question1 === "y" || question1 === "yup" || question1 === "yep") { | |
alert("Well hello Northwesterner! " + "Seattle is a wonderful place to grow up."); | |
} else { | |
alert("Didn\'t think so."); | |
} | |
var question2 = prompt("Do you play the drums?"); | |
question2 = question2.toLowerCase(); | |
console.log("Response 2: " + question2); | |
if (question2 === "yes" || question2 === "y" || question2 === "yup" || question2 === "yep") { | |
alert("Fun! I love playing drums!"); | |
} else { | |
alert("That\'s cool."); | |
} | |
var question3 = prompt("What is your favorite beverage?"); | |
question3 = question3.toLowerCase(); | |
console.log("Response 3: " + question3); | |
if (question3 == "water" || question3 == "water.") { | |
alert("Yum, me too! " + question3 + " is the best!"); | |
} else { | |
alert("That\'s a nice drink."); | |
} | |
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> | |
<head> | |
<title>Guessing Game personal questions</title> | |
</head> | |
<body> | |
<script src='game.js' type="text/javascript"></script> | |
<h1></h1> | |
<p></p> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment