Whats parser error how do I fix it? My code below


#1

var troll = prompt("Which Game Mode do you chose? 1.Arcade 2.GhostFlaw 3.Multiplayer ?").toUpperCase();

switch(troll) {
case 'ARCADE':
console.log("Get ready for the battle of your life");
break;
var col = prompt("Which level would you choose? 1.Beginner 2.Amature 3.Professional") .toUpperCase();
var opl = prompt("Are you ready? Yes(Y) No(N)") .toUpperCase();
if (col=== 'BEGINNER'
&& opl=== 'Y'){
console.log("Lets roll");
} if(col==='AMATURE' && opl==='Y'){
console.log("You are no");
}if(col==='PROFESSIONAL' && opl==='Y'){
console.log("Difficulty level set to infinyt");

  }else{
      console.log("tired");
  }

  }

  case 'GHOSTFLAW':
  console.log("Get ready for the Ghosts");
  break;
  case 'MULTIPLAYER':
  console.log("Are your friends ready?");
  break;
  default:
  console.log("Select anyone atlas");
  break;

}


#2

@coreslayer53985

switch(troll) {
 case 'ARCADE':
   console.log("Get ready for the battle of your life");
   //break;
   var col = prompt(
       "Which level would you choose? "+
       "1.Beginner 2.Amature 3.Professional") .toUpperCase();
   var opl = prompt("Are you ready? Yes(Y) No(N)") .toUpperCase();
   if (col=== 'BEGINNER' && opl=== 'Y'){
      console.log("Lets roll");
   } 
   if(col==='AMATURE' && opl==='Y'){
      console.log("You are no");
   }
   if(col==='PROFESSIONAL' && opl==='Y'){
      console.log("Difficulty level set to infinyt");
   }else{
      console.log("tired");
   }
   break;

 case 'GHOSTFLAW':
   console.log("Get ready for the Ghosts");
   break;
 case 'MULTIPLAYER':
   console.log("Are your friends ready?");
   break;
 default:
   console.log("Select anyone atlas");
   //break;  not needed with a default-case
}

#3

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