Skip to content

Instantly share code, notes, and snippets.

@jpsullivan
Created July 7, 2015 16:30
Show Gist options
  • Save jpsullivan/f97b7d0f13529ed6aa23 to your computer and use it in GitHub Desktop.
Save jpsullivan/f97b7d0f13529ed6aa23 to your computer and use it in GitHub Desktop.
JS - CodeAcademy
var user = prompt("As you walk through a forest, you come across a Buckethead on the ground, woozy from hunger. Do you APPROACH, RUN AWAY, or CALL OUT?").toUpperCase();
switch(user) {
case 'APPROACH':
var offended = prompt("Are you offended by her state of attire? (YES or NO)?").toUpperCase();
var foodTho = prompt("Do you give her food? (YES or NO)?").toUpperCase();
if(offended === 'NO' || foodTho === 'YES') {
console.log("You only need one of the two! She leaps up and befriends you with enthusiasm!");
} else {
console.log("wow, a busybody AND a tightwad. You're kind of a jerk. Its okay Buckethead becomes your friend anyway, whether you want it or not.");
break;
}
break;
case 'RUN AWAY':
console.log("You get the hell out of dodge cuz you've heard stories about this one and know she's nothing but trouble.");
break;
case 'CALL OUT':
var alright = prompt("Do you ask why she isn't dressed? (YES or NO)?").toUpperCase();
var needClothes = prompt("Did you ask if she needs clothes? (YES or NO)?" ).toUpperCase();
if(alright === 'YES' && needClothes === 'YES') {
console.log("She hops up and is visibly upset at you. 'You calling me a whimp, pal?' she says as threateningly as a 5-foot woman with a cowlick can ask.");
break;
} else {
console.log("She seems to, on some level, appreciate that you 'get it' and befriends you, also she eats some of your rations... sorry.");
}
break;
default:
console.log("You stumble around like an idiot, clearly bereft of any knowledge on how to continue down one of three simple paths of choice. 'what a asshead' you can hear the drained hussie mumble in your direction.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment