JSFiddle - React, Tailwind, and code Playground

by Sean Conaway

JavaScript

var choice1 = prompt("sleep or open");
if (choice1 === "sleep") {
    var choice2 = prompt("sleep again or open");
} else if (choice1 === "open") {
    var choice3 = prompt("village or castle");
} else {
    alert("I didn't understand you. You die.");
}
if (choice2 === "sleep again") {
    alert("you die");
} else if (choice2 === "open") {
    var choice4 = prompt("stay or leave");
} else {
    alert("I didn't understand you. You die.");
}
if (choice4 === "stay") {
    alert("happily ever after. then you die.");
} else if (choice4 === "leave") {
    alert("you spend the rest of your days sad and miserable. then you die.");
} else {
    alert("I didn't understand you.  You die.");
}
if (choice3 === "village") {
    var choice5 = prompt("steal apple or path?");
} else if (choice3 === "castle") {
    var choice6 = prompt("dungeon or slap");
} else {
    alert("I didn't understand you. you die.");
}