n = 8
for row = 0 to 3
   sz = 100 / n
   for i = 0 to n - 1
      c = i / (n - 1)
      if row mod 2 = 1
         c = 1 - c
      .
      color3 c c c
      move sz * i 75 - row * 25
      rect sz + 1 25
      sleep 0.02
   .
   n *= 2
.
