I am not sure if it is a problem of my code, but when I am trying to run this game, it always have those prompt part come first. After that, all the description comes out TOGETHER ! Could someone tell me how to fix this part please?


#1


Replace this line with your code.


#2

Can you please post all the code in question so that we can get a better understanding of the problem?

Thanks


#3

What's he's asking is why do all the user prompts show up first in your browser, and then all the console.log statements print out. It's super annoying, for example, you can say you're under 13 but the rest of the prompts still ask you the rest of the questions, then it prints out the age failure message, but then the rest of Justin Bieber's dialogue with the user.

This lesson should walk you through a game that exits the prompts and shows the console log line by line for each step, so it feels more like a game.


#4

facing same issue, is it the way it is supposed to be or an issue at my end?


#5

I've seen several posts like this regarding the same issue. It has something to do with the browser you use. Try submitting the code on different browsers and see if there is a difference.


#6

I have the same problem, my code is like this:

confirm("Are you ready?");
var age=prompt("What's your age?");
if (age<13) {
console.log("You are allowed to play but I will take no responsibility");
}
else {
console.log("Let's go now!");
}
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("Please rate my game!");
if (feedback>8) {
console.log("Thank you! We should race at the next concert!");
}
else {
console.log("I'll keep practicing coding and racing.");
}


#7

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