Just showing off


#1

No problems here, just showing off, thought I'd have a bit more fun with it! And those having any problems can take a look here too! (Sorry if it got confusing to copy)

var user = prompt ("You came across a beautiful princess in a tall tower, do you talk to her? YES or NO").toUpperCase();
switch (user) {
case 'YES':
console.log ("You have chosen to talk to the princess");
var yes = prompt ("She tells you that she needs to be saved. Do you save her? YES or NO").toUpperCase();
switch (yes) {
case 'YES':
console.log ("You have chosen to save the princess");
var yes2 = prompt ("You must kill a deadly dragon, will you sir brave knight? Yes or No?").toUpperCase();
switch (yes2) {
case 'YES':
var sword = prompt ("You have discovered the dragon's lair, did you bring your magic sword? YES or NO").toUpperCase();
var shield = prompt ("Have you brought your magic shield? YES or NO").toUpperCase();
if (sword === 'YES' && shield === 'YES') {
console.log ("Congratulations! You are well equipped and slayed the dragon!");
} else {
console.log ("I'm sorry you did not kill the dragon, he burninates you.");
}
break;
case 'NO':
console.log ("You run away, unfortunately the dragon caught your scent and chased you down and ate you.");
break;
default:
console.log("please put YES or NO");
}

            break;
            case 'NO':
                console.log("What a loser, you walk away");
                var yes3 = prompt ("As fortune would have it though, you have a chance to redeem yourself, and you come across a frog in the road. Do you talk to it? YES or NO?").toUpperCase();
                    switch (yes3) {
                        case 'YES': 
                            var yes4 = prompt ("You speak to the frog, the frog tells you that it used to be a beautiful princess, but needs to be kissed. Do you kiss the frog? YES or NO?").toUpperCase();
                            switch (yes4) {
                                case 'YES':
                                    var breathMints = prompt ("Did you eat breath mints? YES or NO?").toUpperCase();
                                    var brushTeeth = prompt ("Did you brush your teeth? YES or NO?").toUpperCase();
                                    if (breathMints === 'YES' || brushTeeth === 'YES') {
                                        console.log ("The frog turned into a beautiful princess and you married her!");
                                    } else {
                                        console.log ("You're disgusting, you didn't brush your teeth or eat breath mints? You killed the frog, great job!");
                                    }
                                break;
                                case 'NO':
                                    console.log ("You are truly hopeless, you walk yourself off the cliff.");
                                break;
                                default:
                                    console.log ("Please answer YES or NO")
                            }
                        break;
                        case 'NO':
                            console.log ("You are truly hopeless, you walk yourself off the cliff.");
                        break;
                        default:
                            console.log ("Please answer YES or NO")
                    }
            break;
            default:
                console.log("Please input YES or NO");
        }
     break;
 case 'NO':
     console.log ("You walk away you big pansy");
     break;
 case 'MAYBE':
     console.log ("There is no MAYBE");
     break;
 default:
    console.log("You need to answer YES or NO");

}


#2

good game!!!! I tried it and it is really fun! Great!!


#3

Thanks! Glad it worked out!