Code you own adventure justin bieber


#1


confirm("ready?");
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.'");
}


how come this is wrong? :(( help pls


#2

HI what's error do you get?


#3

Oops, try again. Did you add an if statement to your code?

This. :(( thanks for the reply btwww.


#4

Do you still have the is statemnt that check for the age?


#5

if (age < 13); {
console.log("you can play but I take no responsibility");
}
else {
console.log("Good Luck!");
}

i copy-pasted that code to mine just from the other thread. is this the one? it's not working still :((


#6

this part remove the ; after the if condition

if (age < 13); <== this one

#7

oh okay. i'll try again!! big help! thanks! :))


#8

Now you have to create different scenarios. Good thing we know how to do that using if / else statements.

If userAnswer is "yes", print out: "You and Bieber start racing. It's neck and neck! You win by a shoelace!"

Otherwise, print out: "Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'"

Use an if / else statement to write out the last part of this game!

Make sure to check the console for error messages and suggestions for how to fix them.

(these are the instructions given)

and below is my code:

confirm("ready?");
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.'");
}

it is really not working. i just gigured out that im still not in the "age" part so maybe it'll really not work if i put it there. so i removed it instead and followed the instructions. how come it's still not working? :(( im stuck. Thank you! :))


#9

the age lesson is at Lesson: 2.Old enough to play? and your are at Lesson: 5.The story heats up! so you need of it on your code ,
and you should add a prompt that aske for the age like that

var age = prompt("How old are you?");
if (age < 13) {
    console.log("you can play but I take no responsibility");
}
else {
    console.log("Good Luck!");
}
confirm("ready?");
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.'");
}

#10

ohhhhhhhh. maybe i deleted the entire code earlier. THANKS AGAIN! :)))


#11

Hi there, does anybody know what's wrong in here? Can't figure it out

var age = prompt("what's your age?")
if (age < 13) {
console.log ("not allowed to play, but we take no responsability")
}
else {
console.log ("go ahead")
}
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?");


#12

Hi what error do you get?


#13

hello, I get : "Did you remember to console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'"); ?


#14

HI reallly don't see the difference but try that

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

#15

■■■■, it worked!

thnx a lot!