Code Your Own Adventure, problem


#1

HI guys.

I have just completed and passed the java code your own adventure game section but it seems as if something is not working as it should.

Whenever I run my code the game does not add anything to the console.log until the process is completed. I passed all the checkpoints but I have watched others do this and after the player states their age the console prints out the responses and tells the story. Mine, on the other hand, skips to the prompt asking whether the player would like to race Justin Bieber.

Here is my code. Any help would be greatly appreciated.

confirm("Are you ready to being your adventure");

var age = prompt("How old are you. It appears as if you are little more than a child");

if (age < 13){
console.log("You think that someone so young is capable of setting of alone. Return to your mother child. This is not a journey for one such as you. The night is dark and full of terrors. If you proceed along this path ignoring my warning, you will die.");
}
else
{
console.log("I see. Then there is no reason you cannot begin. However, be warned: Many who have taken these first few steps have regretted doing so further down the road.");
}

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?");

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 this game out of 10. 1 being terrible, why is your story about Justin Bieber and 10 being great");

if (feedback >8){
console.log("Thank you! We should race at the next concert!");
}
else
{
console.log("I'll keep practising coding and racing");
}

I understand that, for some reason it forces you to tell a justin Bieber story. However, when I first stared it looked like it would allow you to tell any story you pleased. This doesn't seem to be the issue though, as it appears to be a problem with the functionality rather than the content of the string. Please help.


#2

This is a bug. I've read it happens to people using Chrome. It happens to me using Safari. Not sure what other browsers have the same issue.


#3

3 posts were split to a new topic: Did you remember to put in the 'yes' answer option?"


Did you remember to put in the 'yes' answer option?"
#4

i have the same issue with Firefox


#5

Yeah this seems to be a common bug. I have the same issue on Windows 10 Pro 64-bit in Chrome 58.0.3029.110


#6

I have the same in an Chrome Book


#7

same here. It will first throw out all the prompts. After the final prompt, the console window is populated with text.


#8

come around my house to meet at my sisters birthday on 22 if possible​:blush:


#9

You are missing the ===
at line
" if (userAnswer === "Yes") { "


// Check if the user is ready to play!
console.log("Hi, Are you ready to play")
confirm(" Click OK to play ")
var age = 0;
var age = prompt("What age are you ?");

if ( age < 13){
console.log("You are not older than 13, I do not take responsibility for the game outcome");
} else {
console.log("Continue with the 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 = 0;
var userAnaswer = 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 this game from 1 to 10");
console.log(feedback);
if (feedback > 8){
console.log("Thank you! We should race at the next concert!");
}
else {
console.log("I'll keep practicing coding and racing.");
}