click f12 -> console -> paste it in -> press enter
var user = prompt("You are walking along the road when you encounter a zombie. Would you like to FIGHT the zombie, PAY the zombie, or RUN from the zombie?").toUpperCase();
switch (user){
case 'FIGHT':
var fight = prompt("You punch the zombie, but it almost bites you. Do you run, or fight?").toUpperCase();
var choose = prompt("Choose wisely. Run, or fight? (Use same answer as last time.").toUpperCase();
if(fight === 'FIGHT' || choose === 'FIGHT') {
alert("You beat the zombie in a fist fight! Nice!");
}
else {
alert("You couldn't get away, and the zombie ate you. Better luck next time.");
}
break;
case 'PAY':
var swag = prompt("The zombie only accepts Zombie Dollars. Do you have Zombie Dollars on you?").toUpperCase();
var test = prompt("The zombie agrees not to eat you if you give him all your Zombie Dollars. Do you agree?").toUpperCase();
if(swag === 'YES' && test === 'YES') {
alert("The zombie lied. He took your Zombie Dollars and ate you. You shouldn't trust a zombie..");
}
else {
alert("The zombie gets annoyed and eats you. Better luck next time!");
}
break;
case 'RUN':
var table = prompt("Do you think you can outrun the zombie? (This zombie is very slow)").toUpperCase();
var fargo = prompt("You start running from the zombie, and someone in a car pulls up to you. They offer you a spot in the car. Do you continue running?!").toUpperCase();
if(table === 'YES' && fargo === 'YES') {
alert("Nice! You outran the zombie and didn't get in the car with the stranger.");
}
else {
alert("You should've kept running. You died. Better luck next time!");
}
default:
console.log("The zombie didn't like your answer, so the zombie killed you.")
}