Code own adventure


#1

Code your own adventure

Hi could somebody please have a look at my code to see where I am going wrong.

I keep getting this messgae: "oops try again theres a problem with your syntax "

Thanks,

confirm("I am ready to play!");

var age = prompt("whats your age");

if (age <= 13)
{
console.log("You are allowed to play but I take no responsibility");
}

else
{
console.log("Go catch them all!!!");
}

console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");

console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");

var userAnswer = prompt("Do you want to race Bieber on stage?");

if (userAnswer === "Yes")
{
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}

else
{
console.log("Oh no! Bieber shakes his head and sings 'I set the pace, so I can race without pacing.'");
}

var feedback = prompt("Rate my game out of 10");

if (feedback < 8)
{
console.log("Thank you! We should race at the next concert!");
}

else
{
console.log(I'll keep practicing coding and racing.");
}


#2

maybe first if statment without equal


#3

The feedback if? I tried adding an equals to that one but I get the same error.


#4

Check to see if all your text strings have quotation marks.


#5

}

else
{
console.log(I'll keep practicing coding and racing.");
}

Unclosed string
missing semicolon
unmatched curly braces


#6

} else {
console.log("I'll keep practicing coding and racing.");
}

Fixed your code maybe?

Hoped that helped

Your's truly, Peter


#7

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