Hi
Can you make this code more elegant
flag1 = (0,1)
flag2 = (0,1)
flag3 = (0,1)
flag4 = (0,1)
flag5 = (0,1)
for i1 in flag1
for i2 in flag2
for i3 in flag3
for i4 in flag4
for i5 in flag5
println("$i1 , $i2, $i3, $i4, $i5")
end
end
end
end
end
Back ground information, I was writing a case statement for a sql query
that check 5 flags (each flag is boolean, yes or no, 1 or 0)
And based on the combination of the 5 flags I decide the record final status
I wanted to make sure that my SQL Case covered all cases
Since I have 5 flags then its 2 to the power of 5 case, 32 cases
I was about the type the 32 cases in excel and go through them one by one to see if I missed any
I then decided to write those few line to help me (since I am learning Julia anyway on the side)
This obviously look, not so elegant, and that is only because I am nice to me
But it works, I copied the output to excel and it helped me make sure I covered all the cases
And provided nice docs for the query