SyntaxError: Unexpected token case


#1

var user = prompt("You are fighting a fearsome dragon! Do you ATTACK, DODGE or BLOCK").toLowerCase();

switch(user) {
case 'attack':
var weapon = prompt("Do you have a good weapon?(YES or NO)").toLowerCase();
var strong = prompt("Are you a strong warrior?(YES or NO)").toLowerCase();
if(weapon === 'yes' && strong === 'yes') {
console.log("You defeated the fearsome dragon!");
} else {
console.log("Your attack was not enough! The dragon hits you with it's mighty claw! You are killed instantly!");
}
break;
case 'dodge':
var fast = prompt("Are you fast?(YES or NO)").toLowerCase();
var small = prompt("Are you small?(YES or NO)").toLowerCase();
if(fast === 'yes' || small === 'yes') {
console.log("You succesfuly dodge the fearsome dragon's flaming breath!");
} else {
console.log("You were unable to dodge the fearsome dragon's flaming breath! Your skin is melted of your bones!")
break;
case 'block':
var shield = prompt("Do you have a shield?(YES or NO)").toLowerCase();
var strong = prompt("Are you a strong warrior?(YES or NO)").toLowerCase();
if(shield === 'yes' && strong === 'yes') {
console.log("Your block is no match for the power of the fearsome dragon! You are crushed into a mush of bones and flesh!");
} else {
console.log("Your block is no match for the power of the fearsome dragon! You are crushed into a mush of bones and flesh!");
}
break;
default:
console.log("You stand there idly... The dragon steps on you.");
}


#2

Hello. You are missing a semi colon ; and closing bracket } at the end of the above section quoted.