Created
June 21, 2016 18:25
-
-
Save shaisachs/c0966bcde82b94efb39d96ecdd0fd7c3 to your computer and use it in GitHub Desktop.
Coffee algorithm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCoffee() { | |
if (asleep) { | |
return 0; | |
} | |
else { | |
return getCoffee() + 1; | |
} | |
} |
stephengreenfield
commented
Jun 21, 2016
We should also probably define the global variable:
var asleep = (getCoffee() < 1);
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