Unexpected EOF


#1



Code your own Adventure

Hey guys, I am a bit confused about what EOF is and where the errors are. Any help would be appreciated !

confirm ("Do you want to play?");
var age = prompt ("How old are you");
if (age <13) {
    console.log ("We take no responsibility for whatever trauma this game may cause");
}
else {
    console.log("Continue on into the dark world of this game!");
}
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 a pace, so I can race without pacing.'");
}
var feedback = prompt ("Rate the 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

This line:

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

you are missing a quotation mark (") at the end of your string


#3

Oh thanks, i really should have seen that. :disappointed_relieved:

BTW is there any way to make the input of the age just be a numerical value?


#4

yea, but with code not covered yet. We can use functions (loop would be better), but function is taught first, after you finished function we can introduce a method to validate user input.


#5

Okay thank you very much for your help