//Check if the user is ready to play!
var age = prompt("What's your age?");
if(age >= 18)
{
console.log("You are allowed to play but I take no responsibility!");
}
else
{
console.log("You are encougraged to play on!");
}
console.log("\nSnow 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("\nBatman glares at you.");
var userAnswer = prompt("\nAre you feeling lucky, punk?");
if(userAnswer === "yes")
{
console.log("\nBatman hits you very hard. It's Batman and you're you! Of course Batman wins!");
}
else
{
console.log("\nYou did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman.");
}
//feedback
var feedback = prompt("How would you rate the game on a scale of 1 to 10, 10 being the highest?");
if(feedback > 8)
{
console.log("This is just the beginning of my game empire. Stay tuned for more!");
}
else
{
console.log("I slaved away at this game and you gave me that score?! The nerve! Just you wait!");
}
var age = prompt("Hello! please tell me your age before you begin!")
ReplyDeleteif (age < 18)
{
console.log("You are underage, but I suppose you can play at your own risk.")
}
else
{
console.log("Thank you! have fun playing!")
}
var name = prompt("Please tell us your name!")
console.log("Thank you for telling us your name, ")
console.log("________________________")
console.log("You see a man stealing a womans purse, what should you do?")
var answer1 = prompt("ANSWERS: Run like a baby,or save the woman in need!")
if (answer1 === "Run like a baby")
{
console.log("You just watch the whole thing go down and the cops see the man and catch, and arrest him.")
}
else
{
console.log("You run up to the man and attempt to punch him in the face, but you fail and he stabs you in the heart and gets away with murder and stealing.")
}
Thanks for sharing your code Patrick =)
ReplyDeleteYou can improve the following lines
console.log("Thank you for telling us your name, ")
console.log("________________________")
to
console.log("Thank you for telling us your name, " + name + ".")
If you want to learn more, look up string concatenation in Javascript. Godspeed!