Microsoft Small Basic

Program Listing: SRW660
max=3

GraphicsWindow.KeyDown=draw


Sub draw
GraphicsWindow.Clear()

'eerst alles leegmaken
For hoek=0 To 355
vl[hoek]=0
vr[hoek]=0
vw[hoek]=0
endfor

'eerst lopen we rechtsom om de cirkel en maken we willekeurige verschillen
v=0
For hoek=0 To 355
v=v+math.GetRandomNumber(2*max-1)-max
vr[hoek]=vr[hoek]+v
endfor

'daarna lopen we nog eens linksom
v=0
For hoek=355 To 0 Step -1
v=v+math.GetRandomNumber(2*max-1)-max
vl[hoek]=vl[hoek]+v
endfor

For hoek=0 To 355
vw[hoek]=vl[hoek]*hoek/355+vr[hoek]*(355-hoek)/355
endfor


x1=250
y1=350

For t=0 To 355

x2=250+(100+vw[t])*math.Sin(Math.GetRadians(t))
y2=250+(100+vw[t])*math.cos(Math.GetRadians(t))

'GraphicsWindow.SetPixel(150+x1,150+y1,"blue")
GraphicsWindow.drawline(x1,y1,x2,y2)
x1=x2
y1=y2

x3=250+(100)*math.Sin(Math.GetRadians(t))
y3=250+(100)*math.cos(Math.GetRadians(t))
GraphicsWindow.SetPixel(x3,y3,"blue")

endfor
GraphicsWindow.drawline(x1,y1,250,350)
endsub