Code your own adventure - getting the Unexpected Token error


#1

I've gone over this and just can't see what I'm doing wrong..

var race = prompt("You are about to enter Middle Earth. What race would you prefer to be - Elven, Hobbit, or Man?").toUpperCase();

Switch(race) {
Case 'ELVEN':
var love = prompt("Did you fall in love with a human?").toUpperCase();
if(love === "YES") {
console.log("You will live a long life but eventually die and return to the earth.");
} else {
console.log("When the time is right, you may sail to the Grey Havens.");
}
break;
Case 'HOBBIT':
var family = prompt("Are you a Baggins or a Proudfoot?").toUpperCase();
if(family === "BAGGINS") {
console.log("Watch out for wizards!");
} else {
console.log("Look at those feet!");
}
var adventure = prompt("Do you like adventures?").toUpperCase();
if(adventure === "YES" || adventure === "NO") {
console.log("It doesn't matter, you are going on one anyway!");
}
break;
Case 'MAN':
var city = prompt("Are you from Gondor or Rohan?").toUpperCase();
var wizard = prompt("Are you with Gandalf or Saruman?").toUpperCase();
if((city === "GONDOR" || city === "ROHAN") && (wizard === "GANDALF")
{ console.log("Victory is yours!");
} else {
console.log("You are doomed; go to the dark places where you belong!");
}
break;
default:
console.log("You need to enter Elven, Hobbit, or Man.");
}


#2

You have switch and case capitalized.


#3

THANK YOU!! That was it!