n = 15
offs = 10 / n
r = (100 / (3 * n + 1))
step = 360 * 2 / (n - 1)
# 
background 470
clear
for row = 0 to n - 1
   for col = 0 to n - 1
      x = (3 * col + 2) * r
      y = (3 * row + 2) * r
      # 
      h = col * step + row * step
      move (x + offs * cos h) (y + offs * sin h)
      color 999
      circle r
      # 
      h += 180
      move (x + offs * cos h) (y + offs * sin h)
      color 000
      circle r
      # 
      move x y
      color 128
      circle r
   .
.
