aUCBLogo Demos and Tests / pixtest
be pixtest
cs ht
setScreenColor 0
; norefresh
setUpdateGraph false
n=1000
x=Array n
c=Array n
repeat n
[ w=random 360
r=600*rnd^1.1
x.repcount=(List cos w sin w)*r
c.repcount=hsb 360*repcount/n 1/4 1
]
ox=x+0 ; to create the same structure as in x, so that we can use xcopy and x+=v
v=x/100
i=0
t=0
forever
; repeat 10000000
[; t0=timefine
if key? [stop]
xcopy "ox x ; copy only the values (no new nodes are made)
x+=v ; dito
v*=1.02
repeat n
[ if (norm x.repcount) > 300
[ w=random 360
r=300*rnd^1.1
x.repcount=(List cos w sin w)*r
v.repcount=x.repcount/100
]
]
clean
setPixel x c
updateGraph
gc
; t = (i*t + timefine-t0)/(i+1)
; ct (pr 1/t "frames/sec)
; i+=1
]
end