Help with number 5!


#1

Here's my code:

var user = prompt("As you you walk down a trail, you come to three crossroads. The path to your left leads into the woods. The path to your right leads to the beach. The path in front of you leads to plains. If you don't like any of these paths, then you can go back. Do you choose LEFT, RIGHT, STRAIGHT, or GO BACK?").toUpperCase();

switch(user) {
    case 'LEFT':
        confirm("You walk into the woods. It is pitch black. You can se the trees getting thicker and closer. All around you eyes shine like little moons.");
        var ending = prompt("Are ready to know what happens next? YES or NO? please enter YES or NO in uppercase");
        var age = prompt("Are you 13 years old? YES or NO?");
        if (ending === "yes" && age === "yes")
        {
            confirm("Beasts from the wood leap out and attack you! They pouce and slash. You feel blood pouring and then suddenly you wake up. It was just a dream
        }
        else if (ending ==="yes" && age === "no" || ending ==="no" && age === "yes")
        {
            confirm("It turns out the those weren't eyes, they were lamps. Your friends leap out on the bushes and yell 'Surprise!' They oraganized a surprise party for you!"
        }
        else
        {
            confirm("Please enter either one of the options in uppercase: YES or NO. Thanks!");
        }
        break;

    case 'RIGHT':
        confirm("You go down the beach. Then you see a party tent. As you get closer, you realize that the party is for you.");
        break;

    case 'STRAIGHT':
        confirm("When you are half way though the plains, a tornado breaks out and is coming straight at you. You are swept up by the tornado and thrown into the sky. You land with a thud and open your eyes. It was just a bad dream.");
        break;

    case 'GO BACK':
        confirm("You go back home. When you reach your house, you friends surprise you with a surprise party!");
        break;

    default:
        confirm("Please enter either one of the options in uppercase: LEFT, RIGHT, STRAIGHT, GO BACK. Thanks!");
        break;
}

It keeps on saying: "SyntaxError: Invalid or unexpected token"

I can't figure out what is wrong

Thanks for the help


#2

you missed a ) bracket after

confirm("Beasts from the wood leap out and attack you! They pouce and slash. You feel blood pouring and then suddenly you wake up. It was just a dream.

and same here

confirm("It turns out the those weren't eyes, they were lamps. Your friends leap out on the bushes and yell 'Surprise!' They oraganized a surprise party for you!"


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.