JSFiddle - React, Tailwind, and code Playground

by Addison Riley

JavaScript

var verbs = {"study": 1, "work": 2, "procrastinate": 3};
function makeChoice() {
    var args = prompt("You have a test, what do you want to do? study, work, or procrastinate", "").split(" ");
    var cond = verbs[args[0]];
    if (cond === 1) {
        alert("Good choice, you make honors in the class and are asked to go to your new classroom. ");
        return true;
    }
    else if (cond === 2) {
        alert("You work for hours and pass the test, then you graduate and live a very succsesful life. You have a wife and a kid. Many years later when your son is in high school, he asks:'What should I do on this test?'");
        return false;
    }
    else if (cond === 3) {
        alert("You failed and now work at a gas station in Russia... The end. ");
        return false;
    } else {
        alert("English much?");
        return false;
    }
}

var verbs = {"ask for help": 1, "adventure": 2, "leave school": 3};
function makeChoice() {
    var args = prompt("You have no idea where to go... Should you: ask for help, adventure, or leave school? ", "").split(" ");
    var cond = verbs[args[0]];
    if (cond === 1) {
        alert("Good choice, you ask a guy for help, he looks friendly, but he gives you false directions and you end up seeing a drug deal and are forced join the chinese mafia. Go back XD");
        return false;
    }
    else if (cond === 2) {
        alert("You take a wrong turn and fall into a pit of lava filled with lava-leapords! ");
        return false;
    }
    else if (cond === 3) {
        alert("You failed and now work at a gas station in Russia... The end. ");
        return true;
    } else {
        alert("English much?");
        return false;
    }
}
while(!makeChoice()) {};