Sunday, February 17, 2013
Da Sphinx questions
//This is a game about a sphinx that you met on your path. Silly game realized with operator, if/else, switch control. Hope you enjoy.
var questionSphinx = prompt ("Hello dear, what's the thing that has 4 legs when young, 2 when adult and 3 when old?","Be careful whatever you are... Human...").toLowerCase();
switch (questionSphinx){
case 'man':
var again1 = prompt("Don't be sexist! What are you? Kid or man?","You have another chance!").toLowerCase();
var again2 = prompt("You are obviously not here with your thoughts, darling... Are you in love?","Yes or Not?").toLowerCase();
if (again1 === "kid" && again2 === "yes"){alert("Ohhh, that explains a lot, I will let you pass this time, lucky kiddo!");}
else {console.log("The Sphinx reduces you to dust before you might exhale your very last breath!");}
break;
case 'human':
var again3 = prompt("Be more specific, I will destroy you otherwise. Did you mean Man or Woman?").toUpperCase;
var again4 = prompt("Are you nice enough for me?","Yes or No!?!?").toUpperCase();
if (again3 === "WOMAN" || again4 === "YES"){alert("You may pass by me, then, you cutie-pie!");}
else {console.log("Your days strolling on this planet end here, da Sphinx is eating, chewing and spitting you!");}
break;
case 'woman':
alert("You are so right my dear, you win my game and you shall pass.");
break;
default:
console.log("That is not an acceptable answer, now the Sphinx will have to kill you by tearing your body apart in pieces.");
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Please, comment!