Last active
December 15, 2015 08:59
-
-
Save muddydixon/5235352 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
params = | |
alpha: [1,2,3] | |
beta:[1,5,7,9,2] | |
gamma:[2,3] | |
set = [] | |
prods = {} | |
prod = 1 | |
for param, idx in d3.entries(params) | |
prods[param.key] = prod | |
prod *= param.value.length | |
for i in [0..prod - 1] | |
set[i] = {} | |
for key, val of params | |
set[i][key] = val[(0|i / prods[key]) % val.length] | |
console.log set |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
配列の組み合わせをゲットする方法です