Skip to content

Instantly share code, notes, and snippets.

@terrancebryant
Created September 27, 2014 02:57
Show Gist options
  • Select an option

  • Save terrancebryant/637d986b9569d37f80d8 to your computer and use it in GitHub Desktop.

Select an option

Save terrancebryant/637d986b9569d37f80d8 to your computer and use it in GitHub Desktop.
Simple Js Game // source http://jsbin.com/bojuju/1
<!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>
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