Unexpected Token Case


#1

var user = prompt("You are a knight walking through the woods, and you stumble upon a horde of barbarians. Do you RUN, FIGHT, or SURREDER.").toUpperCase();

switch(user) {
case 'RUN':
var speed = prompt("Are you fast? (YES or NO)").toUpperCase();
var armor = prompt("Are you wearing full body armor or no? (YES or NO)").toUpperCase();
if(speed == "YES" && armor == "YES"){
console.log("You are able to get away. Congratulations you didn't die today!");
}
else {
console.log("You were not able to get away due to either you being slow or you wearing full body armor. You died");
case 'FIGHT' :
var skill = prompt("Are you an excellent fighter? (YES or NO)").toUpperCase();
var armor = prompt("Are you wearing full body armor? (YES or NO)").toUpperCase();
if(skill == "YES" && armor == "YES"){
console.log("You killed all of them!");
}
else {
console.log("You died.");
case 'SURRENDER':
var charisma = prompt("Are you a charismatic character? (YES or NO)").toUpperCase();
var negotiator = prompt("Can you negotiate? (YES or NO)").toUpperCase();
if(charisma == 'YES' && negotiator == 'YES'){
console.log("You negotiated your way out and gained their favor by joking and sharing common interests.");
}
else if(charisma == 'NO' && negotiator == 'YES'){
console.log("You were able to convince them not to kill you, but you do not know what they will do with you next.");
}
else if(charisma == 'YES' && negotiator == 'NO'){
console.log("You were able to convince them not to kill you, but you do not know what they will do with you next.");
}
else {
console.log("You died");
}
default:
console.log("You died.");
}


#2

@methodblaster21219,
You are forgetting to close-off 2 ELSE code-blocks with their own closing-curly-bracket-}