Skip to content

Instantly share code, notes, and snippets.

@varjmes
Last active December 23, 2015 16:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save varjmes/6663457 to your computer and use it in GitHub Desktop.
Save varjmes/6663457 to your computer and use it in GitHub Desktop.
// Check if the player is ready to play!
confirm("Are you ready to begin?");
// How old is the player?
var age = prompt("How old are you?");
if (age < 18) {
console.log("Fine, you can play, but I'm not responsible for you.");
} else {
console.log("Let's go!");
}
// The thought-provoking, award winning, fantastical plot.
// No applause necessary.
console.log("You're walking down the road, minding your own business when you're approached by an elderly woman.");
console.log("\"Help me!\" she says.");
var userAnswer = prompt("Do you want to help this elderly woman?");
if (userAnswer.toLowerCase() === "yes") {
console.log("You approach her. She hits you in the face with her bag. You die.");
} else if (userAnswer.toLowerCase() === "no") {
console.log("You walk away from her. She catches up to you and hits you in the face with her bag. You die.");
} else {
console.log("Useless Error notification, indicating you messed the game up. Congratumalations. You die.");
}
// Rate my game pls
var feedback = prompt("On a scale from 1-10, how good was this game?");
if (feedback > 8) {
console.log("Too right.");
} else {
console.log("I hit you in the face with my bag. You die.");
}
@varjmes
Copy link
Author

varjmes commented Sep 22, 2013

Thanks to @benhowdle89 for the help with the .toLowerCase() function :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment