var user = prompt("What would you do if a Troll tried to kill you and you were in a cave, cornered? Would you run, hide, give money, fight?").toLowerCase(); switch(user){ case 'run': console.log("There is nowwhere to run to, you die!"); break; case 'hide': var hideOptions = prompt("Where would you hide, behind a rock, or behind a troll?").toLowerCase(); switch(hideOptions){ case'rock': console.log("The troll does not see anyone and leaves."); break; case 'troll': console.log("You will be caught and killed."); break;} break; case'fight': var strong = prompt("How courageous! Are you strong (YES or NO)?").toUpperCase(); var smart = prompt("Are you smart?").toUpperCase(); if(strong === 'YES' || smart === 'YES') { console.log("You only need one of the two! You beat the troll--nice work!"); } else { console.log("You're not strong OR smart? Well, if you were smarter, you probably wouldn't have tried to fight a troll. You lose!");} break; case 'give money': var money = prompt("All right, we'll pay the troll. Do you have any money (YES or NO)?").toLowerCase(); if (money ==="no"){ console.log("Why would you say you'd give money. You will die.");} else{ var dollars = prompt("Is your money in Troll Dollars?").toUpperCase();} if(money === 'YES' && dollars === 'YES') { console.log("Great! You pay the troll and continue on your merry way."); } else { console.log("Dang! This troll only takes Troll Dollars. You get whomped!"); } break; default: console.log("I didn't understand your choice. Hit Save and Submit, and try again, this time picking FIGHT, PAY, or RUN!"); }