Skip to content

Instantly share code, notes, and snippets.

@breanneboland
Created February 6, 2015 03:26
Show Gist options
  • Save breanneboland/3c00757bdc430f447e82 to your computer and use it in GitHub Desktop.
Save breanneboland/3c00757bdc430f447e82 to your computer and use it in GitHub Desktop.
<script>
var guess;
guess = prompt("What color am I thinking of?");
switch(guess) {
case 'yellow':
alert("Mmm, nope, but it's half the answer.");
break;
case 'red':
alert("Warmer. Slightly too warm, actually.")
break;
case 'blue':
alert("Less sky, more grass.");
break;
case 'green':
alert("YOU ARE THE WINNER! No, you don't win anything. But you guessed a thing right. Enjoy the self-esteem boost.");
break;
case 'orange':
alert("That is a flavor, not a color. Don't contradict me.");
break;
case 'purple':
alert("Wrong, but now I kind of wish I'd thought of that instead.");
break;
case 'indigo':
alert("Newton was being superstitious with this stuff. Stop it.");
break;
default:
alert("That is not a color, or at least not one my human overlord saw fit to put in her homework.")
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment