Last active
August 29, 2015 14:02
-
-
Save pixelknitter/77a8c4e428dedea4c2ac to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var puzzlers = [ | |
function ( a ) { return 8*a - 10; }, | |
function ( a ) { return (a-3) * (a-3) * (a-3); }, | |
function ( a ) { return a * a + 4; }, | |
function ( a ) { return a % 5; } | |
]; | |
var start = 2; | |
var applyAndEmpty = function(num, queueOfFunctions) { | |
var value = queueOfFunctions.shift()(num); | |
alert(value); | |
if (queueOfFunctions.length == 0) { return value; } | |
return applyAndEmpty(value, queueOfFunctions); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment