Code Your Own Adventure 2 number 5 problem


#1

I have the error SyntaxError: missing ) in parenthetical but I can't find what's missing.


var user = prompt("The Dragons seek your counciel,young wizzard. It is on a matter of great importance. They want to know why you stole from them, and answer quickly, your dangeling over a large pit and dragons don't like to be keeped waiting. So, why did you do it, did you do it BECAUSE I COULD, FOR MY FAMILY, or YOU HAD THE RIPE BANANA ALL ALONG?","Type your answer here").toUpperCase();

switch(user){
    case 'BECAUSE I COULD':
        var  really = prompt("Because you could? What in the world would possess someone like you to...., but you didn't here the rest, becase as the Dragon monologed you saw a way to escape. It could be risky, do you take it, YES or NO?").toUpperCase();
        if(really === 'YES'){
            console.log("You take the chance, but the Dragon spots you. She says, 'Not so fast young wizzard, we have much to discuss. That is before I become board with this game and find something else to do.'You are improssioned for the rest of your life, it was a remarkably short one.");
        }
        else{console.log("You listen to her drone on and on, she asks you a few more question which you answer curtly. Then she gets board and drops you. It's a short fall ,but you have time to think, 'Oh zar.... then you fall into the gapeing mouth of a young dragon below.");
        }
    
    break;
    case 'FOR MY FAMILY' :
        var family = prompt("Do you actualy have a family? YES or NO.").toUpperCase();
        var request = prompt(" Did you really do it for them? YES or NO.").toUpperCase();
        
        if(family==='YES' && request==='YES'){
            console.log("'How sweet,'says the Dragon. I admire loyalty. I would normaly let you live, but you tried to steal from me and I'm hungery.' She opens her mouth and swallows you.'");
  
        }; 
        else{
            (console.log("'Liar!' the Dragon snarals and you are promptly burnt to a crisp.");
        };
    break;
    case'YOU HAD THE RIPE BANANA ALL ALONG':
        var question = prompt("Where you surching for The Ripe Banana? YES or NO.").toUpperCase();
        var j = prompt("Are you The Purple Knight? YES or NO.").toUpperCase();
        if(question === 'YES' || j === 'YES'){
        console.log("The Dragon opens her mouth to swallow you, but then The Ripe Banana happens and you are saved.");
        };
        else{
            console.log("You die, the Dragon accidently drops you on some convient spikes.");
        };
        break;    
    default:
        console.log("Wrong answer dragons, don't like wrong answers. She eats you.");
}


#2

Sorry about the code it copied strangely.


#3

(console.log("'Liar!' the Dragon snarals and you are promptly burnt to a crisp.");


#4

Thank you but now I have a new error SyntaxError: expected expression, got keyword 'else'.


#5

Never mind found the problem.


#6

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