Problem with syntax - please help


Oops, try again. There was a problem with your syntax.
SyntaxError: Unexpected token {

var dragon = prompt("A Dragon appears. Do you RUN, FIGHT or PAY", "Type your answer: RUN, FIGHT or PAY").toUpperCase();

    case "RUN":
        var fast = prompt("Are you fast?", "YES or NO").toUpperCase();
        if (fast === "YES"){
            console.log("Nice! You ran away from the Dragon!");
                console.log("Oh no! It looks like you're in the dragon's stomache");
    case "FIGHT":
        var strong = prompt("Are you strong?", "YES or NO").toUpperCase();
        var brave = prompt("Are you brave?", "YES or NO").toUpperCase();
        if(strong === "YES" && brave === "YES"){
            console.log("Congratulations! You defeated the Dragon! You are a true Knight!");
                console.log("The dragon burns you!");
    case "PAY":
        var money = prompt("Do you have money?", "YES or NO").toUpperCase();
        var gold = prompt("Do you have gold?", "YES or NO").toUpperCase();
        if(money === "YES" || gold === "YES"){
            console.log("Great! The Dragon left you alone!");
                console.log("If you can't pay - you die!");
        console.log("Wrong answer! You will die in pain!");


Found the mistake. Typo. Sorry for the post.


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