Advertisement
Crenox

Codeacademy Javascript Code Adventure Game

Dec 3rd, 2015
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. //Check if the user is ready to play!
  2. confirm("Are you ready to play?");
  3. var age = prompt("What's your age?");
  4. if(age <= 18)
  5. {
  6. console.log("Go away.");
  7. }
  8. else
  9. {
  10. console.log("Come along.");
  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.  
  16. if (userAnswer === "yes")
  17. {
  18. console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
  19. }
  20. else
  21. {
  22. console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
  23. }
  24.  
  25. var feedback = prompt("Rate game 1 - 10.");
  26.  
  27. if (feedback = 8)
  28. {
  29. console.log("Thank you! We should race at the next concert!");
  30. }
  31. else
  32. {
  33. console.log("I'll keep practicing coding and racing.");
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement