Skip to content

Instantly share code, notes, and snippets.

View suguru03's full-sized avatar
👨‍💻
\\ TypeScript!! //

Suguru Motegi suguru03

👨‍💻
\\ TypeScript!! //
View GitHub Profile
/**
* 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);
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()); // 状況に応じて不要
}
}