Created
September 27, 2014 02:57
-
-
Save terrancebryant/637d986b9569d37f80d8 to your computer and use it in GitHub Desktop.
Simple Js Game // source http://jsbin.com/bojuju/1
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="Simple Js Game" /> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <h3>Simple JS game</h3> | |
| <script id="jsbin-javascript"> | |
| confirm("Would you like to play"); | |
| var age = prompt("What's your age"); | |
| var userAnswer = prompt("Do you want to race Bieber on stage?"); | |
| var feedback = prompt("Please rate the game out of 10!"); | |
| if( age < 13) | |
| { | |
| } else | |
| { | |
| console.log("You are not allowed to 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?'"); | |
| 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.'"); | |
| } | |
| if(feedback > 8) { | |
| console.log("Thank you! We should race at the next concert!"); | |
| } else { | |
| console.log("I'll keep practicing coding and racing."); | |
| } | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">confirm("Would you like to play"); | |
| var age = prompt("What's your age"); | |
| var userAnswer = prompt("Do you want to race Bieber on stage?"); | |
| var feedback = prompt("Please rate the game out of 10!"); | |
| if( age < 13) | |
| { | |
| } else | |
| { | |
| console.log("You are not allowed to 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?'"); | |
| 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.'"); | |
| } | |
| if(feedback > 8) { | |
| console.log("Thank you! We should race at the next concert!"); | |
| } else { | |
| console.log("I'll keep practicing coding and racing."); | |
| }</script></body> | |
| </html> |
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
| confirm("Would you like to play"); | |
| var age = prompt("What's your age"); | |
| var userAnswer = prompt("Do you want to race Bieber on stage?"); | |
| var feedback = prompt("Please rate the game out of 10!"); | |
| if( age < 13) | |
| { | |
| } else | |
| { | |
| console.log("You are not allowed to 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?'"); | |
| 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.'"); | |
| } | |
| if(feedback > 8) { | |
| console.log("Thank you! We should race at the next concert!"); | |
| } else { | |
| console.log("I'll keep practicing coding and racing."); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment