Power set: Difference between revisions

Content deleted Content added
Mroman (talk | contribs)
+ blsq
Line 1,193:
end
return ret
end
 
--non-recurse implementation
function powerset(s)
local t = {{}}
for i = 1, #s do
local limit = #t
for j = 1, limit do
t[#t+1] = {s[i],unpack(t[j])}
end
end
return t
end