View difference between Paste ID: d32MXznB and 3qyYcMUU
SHOW: | | - or go back to the newest paste.
1
// Check if the user is ready to play!
2
confirm ("Are you ready?");
3
var age = prompt("What's your age?");
4-
if ("age" < 13)
4+
if (age < 13)
5
{
6
console.log("We are not responsiable but you can play");
7
}
8
else
9
{
10
    console.log("Have a great time and have fun");
11
}
12
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
13
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
14
var userAnswer = prompt("Do you want to race Bieber on stage?");
15-
if ("userAnswer" === "yes")
15+
if (userAnswer === "yes")
16
{
17
    console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
18
}
19
else
20
{
21
    console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing'");
22
}
23
var feedback = prompt("Rate this game from 1 - 10");
24-
if ("feedback" > 8)
24+
if (feedback > 8)
25
{
26
    console.log("Thank you! We should race at the next concert!");
27
}
28
else{
29
    console.log("I'll keep practicing coding and racing.");
30
}