I've always wanted to have different coloured squares moving around and creating
new colours during over-laps of two or more. No knowledge for full interaction with
any and all other squares - only two and one number apart - but the moving
program sample of two squares shows what I mean and an obvious colour mix.
open window 640,512
x1=260
y1=200
r1=256
g1=256
b1=0
x2=380
y2=310
r2=256
g2=0
b2=0
m=1
repeat
setdrawbuf vm
vm=1-vm
setdispbuf vm
clear window
if x2-x1<50 or x2-x1>210 m=-m
x1=x1+m
y1=y1+m
x2=x2-m
y2=y2-m
setrgb 1,r1,g1,b1
fill rectangle x1-100,y1-100 to x1+100,y1+100
setrgb 1,r2,g2,b2
fill rectangle x2-100,y2-100 to x2+100,y2+100
setrgb 1,256,256,256
if x2-x1<200 then
circle x2-100,y1+100,5
circle x1+100,y2-100,5
endif
setrgb 1,(r1+r2)/2,(g1+g2)/2,(b1+b2)/2
if x2-x1<200 fill rectangle x2-100,y1+100 to x1+100,y2-100 rem doesn't work with yellow/blue
setrgb 1,0,0,0
text x1-90,y1-80,"box1"
text x2+50,y2+80,"box2"
setrgb 1,256,256,256
until (1=0)