Last active
October 16, 2016 14:28
-
-
Save byronmejia/72abd6356e443c870eff77efa6ca34d5 to your computer and use it in GitHub Desktop.
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
// Helper Function to generate 768 points, as supplied by frandss | |
function testData(){ | |
var output = []; | |
for (var x = 0; x < 768; x ++) output.push(x); | |
return output | |
} | |
function fourtyEightChurner(array, length, current) { | |
if(current > (length - 48)) return 0; | |
subArray = array.slice(current, current + 48); | |
for(var i = current, j = 47; i < current + 48; i++, j--) array[i] = subArray[j]; | |
return fourtyEightChurner(array, length, current + 48 + 48); | |
} | |
// testing with '48' (magic number) | |
var test1 = testData(); | |
fourtyEightChurner(test1, test1.length, 49); | |
console.log(test1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment