Skip to content

Instantly share code, notes, and snippets.

@vanleuven
Created November 1, 2015 23:05
Show Gist options
  • Save vanleuven/980b157d45258bc1c3e4 to your computer and use it in GitHub Desktop.
Save vanleuven/980b157d45258bc1c3e4 to your computer and use it in GitHub Desktop.
Guessing Game assignment November 2, 2015
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.");
}
<!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