var k = %w(a b c) var n = 2 cartesian([k] * n, {|*a| say a.join(' ') })
a a a b a c b a b b b c c a c b c c
Last updated 4 years ago