include "window.inc"
Window "RANDOM SPIRO",800,600,1
sys_mode=4

single pi = 4*Atn(1)
single fc,xq=400,yq=300,xo1,yo1,mo1
single a0,a1,r0,r1,r2,x1,x2,y1,y2,st,i
int r,g,b
int xol,yol,mol

While Key(27)=0 and WinExit=0
ClsColor 0,0,0
r= Rand(64,255)
g= Rand(64,255)
b= Rand(64,255)

r0= Rand(1,5)/10: r1= Rand(1,5)/10: r2= Rand(1,5)/10
fc= Rand(1,200)/10: st= Rand(1,10*10)/100

For i=0 to 180 step st
    a0=(i/r0)*(2*pi)
    a1=((i/r1)*(2*pi))*-1
    x1=xq+(sin(a0)*((r0-r1)*fc))*20
    y1=yq+(cos(a0)*((r0-r1)*fc))*20
    x2=x1+(sin(a1)*((r2)*fc))*20
    y2=y1+(cos(a1)*((r2)*fc))*20
    iF mol= 0 
       mol= 1
       xol= x2
       yol= y2
    Else
       Line xol,yol, x2,y2, 1, r,g,b
       xol=x2
       yol=y2
    End iF
Next 
Events   
FlipBuffer
Pause
Wend
WinEnd