Skip to content

Instantly share code, notes, and snippets.

@davidawad
Created August 13, 2014 00:01
Show Gist options
  • Save davidawad/32f33779da4ee17fc633 to your computer and use it in GitHub Desktop.
Save davidawad/32f33779da4ee17fc633 to your computer and use it in GitHub Desktop.
This is a very simple text game I made that I might integrate to my website
confirm("Are You Ready?") ;
var age = prompt("Are you age 18 or older");
if(age < 18 ) {
console.log("Sorry, you're too young!") ;
}
else{
console.log("Then brace yourself");
}
console.log("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him") ;
console.log('Batman glares at you.');
var userAnswer = prompt("Are you feeling lucky, punk?");
if(userAnswer === 'yes') {
console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
}
else {
console.log("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman." ) ;
}
var feedback = prompt("What did you think of my game on a scale of 1 to 10?") ;
if(feedback > 8 ) {
console.log("This is just the beginning of my game empire. Stay tuned for more!") ;
if(feedback < 8) {
console.log("I slaved away at this game and you gave me that score?! The nerve! Just you wait!" );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment