Choose Your own adventure (new)

by Addison Riley

JavaScript

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");
}