Skip to content

Instantly share code, notes, and snippets.

@shaisachs
Created June 21, 2016 18:25
Show Gist options
  • Save shaisachs/c0966bcde82b94efb39d96ecdd0fd7c3 to your computer and use it in GitHub Desktop.
Save shaisachs/c0966bcde82b94efb39d96ecdd0fd7c3 to your computer and use it in GitHub Desktop.
Coffee algorithm
function getCoffee() {
if (asleep) {
return 0;
}
else {
return getCoffee() + 1;
}
}
@stephengreenfield
Copy link

function thumbsUp() {
  return thumbsUp() + "Nothing could possibly go wrong with this code";
}

@stephengreenfield
Copy link

We should also probably define the global variable:

var asleep = (getCoffee() < 1);

@shaisachs
Copy link
Author

I like to think of this script as the sequel to Inception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment