Choose you own adventure HELp!


#1

var user = prompt("Do you want to attack the Dragon or the Man? or the mystery dragon man?? or just stay").toUpperCase();

switch (user) {
case 'MAN':
var People = prompt("You are serious about attacking the Man?(YES or NO)").toUpperCase();
if (Man === YES) {
var weapon = prompt("Do you have a gun?").toUpperCase();
var Arnold = prompt("Do you have a Arnold ShwarzNegger?").toUpperCase();
}
if (weapon === "YES" && Arnold Swarznegger === "YES") {
console.log("Wow! You're really prepared with 2 weapons! You handily subdue the guard but Arnold dies Continue on your way");

        else if (Arnold Shwarznegger === "YES" || sword === "YES") 
            console.log("You Get injured!  BUt You have beaten the guard. Continue on your way");
        } else {
            console.log("while you are brave, the guard has a sword and has beaten you. You need to escape to tend to your wounds.");
        }
        break;

        case 'Dragon':
            var hidingSpot = prompt("Good choice; wait until you see what you are up against. Do you hide behind a ROCK or in the open?").toUpperCase();
            if (hidingSpot === "Rock") {
                console.log("Good thing you are so thin! You've gone     unnoticed and can continue on your quest.");
            } else {
                console.log("the dragon mistakes you for something else and heals you, You continue with no damage");
            }
            break;

        case 'Mystery Dragon Man':
            var Guards = prompt("just the Thunder Cookie (YES or NO)").toUpperCase();
            var moreGuards = prompt("Has your backup arrived? (YES or NO)").toUpperCase();

            if (moreGuard === "YES") {
                console.log(Arnold Comes back to life and destroys everything except anything you own)
            } else if (moreGuards === "NO") {
                console.log("A twig snaps and everyone looks at you and destroy you")

                case 'stay':
                    console.log("Good choice! That guard wasn't alone; you would've been a goner for sure! Retreat to camp and regroup.");
                    break;

                default:
                    console.log("Sorry! You took too long to decide! The guard has seen you and you have been captured!");
            }

Switch in 4/6
#2

i think your problem is

switch (user) {
case 'MAN': // this is uppercase
var People = prompt("You are serious about attacking the Man?(YES or NO)").toUpperCase();
if (Man === YES) // this Man here is wrong, decide wether you want lowwer case or uppercase, since javascript is case sensitive your code will not run/error

#3

I Fixed that but it still didn't work
?


#4

have you fixed this one too

case 'Mystery Dragon man':
            var Guards = prompt("just the Thunder Cookie (YES or NO)").toUpperCase();
                    //with s
            var moreGuards = prompt("Has your backup arrived? (YES or NO)").toUpperCase();
             //no s?
            if (moreGuard  === "YES")

you have too take a look every variable and arguments and conditions cases sensitiveness


#5

Still it doesn't work? I'm so confused