Loops that iterate/alter code in a binary fashion?
say I wanted to turn the following into a loop:
result = floor(a) + floor(a)
result = ceil(a) + floor(a)
result = floor(a) +ceil(a)
result = ceil(a) + ceil(a)
See how if you imagine floor is 0 and ceil is 1 that the functions change in a binary fashion that follows with the resultX number (binary backwards)
I am working with things that do this often with lots of variations and more complexity, usually 8 but the above example is only 4... Lots of typing!
Is there a way I can set up a loop that can iterate the code itself in a way that follows the binary pattern of the current loop number ?
I'm trying to save on typing here so I don't want a false economy of even more loop logic code just to make it work...
Maybe there is a way ? I just dont know how to search for it - beginner here!