-
-
Save cboursnell/011edf5c2aed2c65dba9 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
@ans=[] | |
def combo(index) | |
n = @parameters.size | |
(0..(n-1)).each do |p| | |
r = 1 | |
@parameters.keys[(p+1)..(n-1)].each do |k| | |
r *= @parameters[k].size | |
end | |
@ans << index/r | |
index = index % r | |
end | |
end | |
600_000.times do |i| | |
@ans=[] | |
hash={} | |
combo(i) | |
@ans.each_with_index do |p,i| | |
#puts "p=#{p}, i=#{i}" | |
a = @parameters.keys[i] | |
hash[a] = @parameters[a][p] | |
end | |
# p hash | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment