Fun One Liners

do while is replaced with while true and a conditional break at the end of the loop.

works in general, except for an empty Superset (S=0) in my alg., without an extra-check.
But not a biggie - an extra-line somewhere can be afforded, I guess.

Right! Thx! :+1:

i=0; while true; processSubset(i); i = (i-S) & S; if i==0 break; end; end

Another ( I haven’t read all the posts, so it may be that someone else posted the same result ) way to get all subsets of a set

ps(l,i=[[]])=isempty(l) ? (return i) : ps(l[2:end], append!(i,vcat.(i,l[1])))


# or

ps(l,i=[[]])=isempty(l) ? (return i) : ps(l[2:end], [i;[append!([l[1]], e) for e in i]])

# I tried to broadcast the append! function, but it doesn't work / I couldn't