JSFiddle - React, Tailwind, and code Playground

by gholt

JavaScript

var begin = confirm("It's been a long journey from your home in the Land of Sunshine and Rainbows.  You are on a very important quest to find the lost artifact of your people.  With it, they will be able to call down great forces of Good and Snuggles in order to win the war with the awful people of Frownsville.  At long last, you come upon the cave that Orwin the Cartographer drew an X on for you.  It looks damp, but whatever.  Onward into the depths!");

var cave = prompt("The cave wasn't that exciting.  You killed some bandits, exploded some traps, got a cool sword, no big deal.  But at the end, you find a motherfucking dragon.  And he's guarding the Sacred artifact!  Do you wanna sneak up on the bastard, jump right out at him, or shoot from afar?","Sneak, jump, or shoot?").toUpperCase();
switch(cave) {
  case 'SNEAK':
	var quiet = prompt("Can you tip toe across a carpet of rice paper without making a sound?").toUpperCase();
	var loud = prompt("Do you stomp everywhere you go?").toUpperCase();
		if(quiet === 'YES' && loud === 'NO') {
			confirm("You sneak in close to the dragon, ready to slay him momentarily!  Suspenseful!");
		} else {
			confirm("You trip over your shield, clanking noisily on the ground.  The dragon eats your face.");
    }
    break;
  case 'JUMP':
	var strong = prompt("Can you chop down a tree in one stroke?").toUpperCase();
	var weak = prompt("Do your arms flop about like noodly appendages?").toUpperCase();
		if (strong === 'YES' && weak === 'NO'){
			confirm("You leap onto the dragon's back, shrieking your home town's name as you raise your sword high into the air!");
		} else {
			confirm("You shriek and leap out at the dragon, falling limply to one side of him.  He wastes no time feasting on your guts.");
		} 
	break; 
  case 'SHOOT':
	var darts = prompt("When you play darts with your buddies, do you get the bullseye often?").toUpperCase();
	var donkey = prompt("Do you routinely lose at Pin the Tail on the Donkey?").toUpperCase();
		if...