askarulytarlan

game JavaScript

Jan 2nd, 2016
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. // Check if the user is ready to play!
  2. confirm("I am ready to play");
  3. var age=prompt("What's your age");
  4. if (age<13){
  5. console.log("You are small for programming");
  6. }
  7. else {
  8. console.log("You are ready to programm");
  9. }
  10. console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'")
  11. console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'")
  12. var userAnswer=prompt("Do you want race Bieber on stage")
  13. if (userAnswer === "yes"){
  14. console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
  15. }
  16. else {
  17. console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
  18. }
  19. var feedback = prompt("Please, rate my game out of 10");
  20. if (feedback > 8) {
  21. console.log("Thank you! We should race at the next concert!");
  22. }
  23. else {
  24. console.log("I'll keep practicing coding and racing");
  25. }
Add Comment
Please, Sign In to add comment