writing a loop that ends when every permutation has been tried
snippet in lua

writing a loop that ends when every permutation has been tried

user2402

local count = 0
local total = 0
for a = 0, 7 do
    for b = 0, 7 do
        for c = 0, 7 do
            for d = 0, 7 do
                for e = 0, 7 do
                    for f = 0, 7 do
                        total = total + 1
                        if compare(a,b,c,d,e,f) == true then count = count +1 end
                    end
                end
            end
        end
    end
end
return count, total