Code your own Adventure, Logical Operators


#1

Getting an unexcited EOF error. Keep double checking my curly braces and can't figure out what's wrong. Thanks for any help!

var att1 = prompt("What is your strongest atttribute? Choices are: Stength, Intelligence, Dexterity, Wisdowm and Constitution").toLowerCase();

var att2 = prompt("What is your second strongest attribute?").toLowerCase();

var user = prompt("What guild would you like to join?").toUpperCase();

switch(user) {
case "THIEF":

    if (att1 === "dexterity" || att2 === "dexterity") {

        console.log("You would make a great thief!")
    }

     else {
        console.log ("You don't you have what it takes to be a thief);
    }
    break;

case "MAGE":

    if (att1 === "intelligence" && att2 === "wisdom") {

        console.log("You would make a fine Mage!");
    
        else {

            console.log("You're too dumb to be a wizard, silly");

        }
    
    break;
    
case "WARRIOR"
 
    if (att1 === "strength" || "dexterity") {
        console.log("You would make a good warrior");
    }
        else {
            console.log("You are too puny and uncoordianated to use bone crushing weapons, fool!")
        }
        
    break;
    
default:
    console.log("That is not an acknowledged guild");
    break;
}

#2

@betaslayer97538 What compiler are you using?


#3

there are bunch of errors, missing ", missing colons, missing curly brackets.

Few of the mistakes:

case "WARRIOR" <- missing colon

and

if (att1 === "intelligence" && att2 === "wisdom") {

        console.log("You would make a fine Mage!");
} <-- the curly bracket was missing here. 
else {

and even more:

console.log ("You don't you have what it takes to be a thief);

missing " at the end of your string


#4

Weird those mistakes weren't there before the cut and paste. Except for the " after thief, Thanks!!!