var user = prompt("You are a spy who was recently sent on a mission to see what the Nazis are planning. As you're escaping the compound you see some of Hitler's men walking towards you. Do you RUN away, try to FIGHT them, or do you HIDE and hope they don't see you?", "Choose RUN, FIGHT, or HIDE.").toUpperCase();
switch(user) {
case 'RUN':
var fast = prompt("Get ready! Are you fast?", "YES or NO").toUpperCase();
var agile = prompt("You'll have to run through the forest! Are you very agile?", "YES or NO").toUpperCase();
if(fast === 'YES' && agile === 'YES') {
console.log("Good job, you out ran the enemies! You escaped! You win!");
}
else {
console.log("Oh no! They caught up with you! You got captured! You lose!");
}
break;
case 'FIGHT':
var strong = prompt("Are you strong?", "YES or NO").toUpperCase();
var gadgets = prompt("Do you have any gadgets?", "YES or NO").toUpperCase();
if(strong === 'YES' || gadgets === 'YES') {
console.log("Thats alright you only need one of them! You beat them up and escaped! You win!");
}
else {
console.log("You're not very strong and you don't have any gadgets? Your not a very good spy. You got captured! You lose!")
}
break;
case 'HIDE':
var quiet = prompt("Are you very quiet?", "YES or NO").toUpperCase();
var small = prompt("Are you a very small person?", "YES or NO").toUpperCase();
if(quiet === 'YES' || small === 'YES') {
console.log("Good, now find a hiding place! They didn't see you! You won!");
}
else {
console.log("Thats not good. You would of been better off running or fighting. You got captured! You lose!");
}
break;
default:
console.log("Thats not a choice! Try again but this time choose RUN, FIGHT, or HIDE");
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.