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
/** | |
* How to use. | |
* 1. access to http://suguru03.github.io/yasuda-benchmark/ | |
* 2. gist("https://gist.github.com/suguru03/b35074cd74e132ffdd7cb10940b3b873").execute(); | |
*/ | |
var root = this; | |
var setup = function() { | |
this.array1 = Array(100); | |
this.array2 = Array(100); |
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
function combinationLoop(list, choose, callback) { | |
(function loop(result, nest, index, length) { | |
while (index <= length + nest - choose) { | |
(nest === 0 ? (result = []) : result)[nest] = list[index++]; | |
if (nest < choose - 1) { | |
loop(result, nest + 1, index, length); | |
} else { | |
callback(result.concat()); // 状況に応じて不要 | |
} | |
} |
NewerOlder