Last active
August 8, 2018 18:19
-
-
Save easierbycode/f25395c7eadca67079b55c4cdef0e6d5 to your computer and use it in GitHub Desktop.
Game: Code Your Own Adventure! --->CodeAcademy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var age = prompt("What's your age?"); | |
| if(age < 13) | |
| { | |
| console.log ("You can not play :("); | |
| } | |
| else | |
| { | |
| console.log("Yay you can play!"); | |
| } | |
| 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?"); | |
| confirm( userAnswer ); | |
| 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 my game"); | |
| if(feedback < 8) { | |
| console.log("Thank you! We should race at the next concert!"); | |
| } else { | |
| console.log( '.. else' ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment