'pattern.bas for SmallBASIC 0.12.0 2015-11-27 Peter W & MGA/B+ 'pixel version 'ported to BaCon by PvE - sep 2016 - use '-z' option to compile small letters include canvas-gd.bac option vartype double window("Pattern",800,600) f=1 : '<================== 1 to 8? speed, the faster the less fine s=500 for frame=1 to 16 for i=0 to WIDTH/f for j=0 to HEIGHT/f x=i*s/600 y=j*s/600 c= x*x+y*y d=c/2 d=d-round(d) if d <0.25 then ink(d*4,0,0,255) elif d<.5 then ink(0,2*d,0,255) elif d<.75 then ink(0,0,4/3*d,255) else cc=0 fi 'rect i*f,j*f step f,f,cc filled 'pset i,j,cc pixel(i,j) next next sync delay(500) : 'for snapshot incr s,5 if s>1000 then s=5 next