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()) {};
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.