Another variation forked from Guilect's second version but with addition of color variation and progress counter and fewer points...
var x as number =0
var y as number=0
var x1 as number=0
var x2 as number =0
var go as number =false
var n as number
var r as number
var label_time as number = 1
var nPoints as number = 500*1000
nPoints = 500*100 '...fewer points gives a faster but coarser animation
' create an offscreen canvas
var OffCanvas as number
OffCanvas = CreateCanvas(getWidth(), getHeight())
'--- end of global declarations ---
function OnLoad()
setBackgroundColor (0,0,0)
setColor (0,196,0)
n = 0
endfunction
function OnDraw()
' draw the offscreen canvas on the main canvas
Draw(OffCanvas, 0, 0, 0, 1, 1, 0, 0)
' set active canvas to the offscreen one
setCanvas(OffCanvas)
n = n + 1
If n > nPoints then
'...do nothing else
else
var iRed as number
var iGreen as number
var iBlue as number = 0
iRed = int(255*(n/nPoints))
iGreen = (255 - iRed)
label_time = label_time-1
if label_time <= 0 then
setColor(50,50,50)
FillRectangle(40, 80, 140, 40)
setColor(iRed,iGreen,0)
print("Points = "+str$(n)+" of "+str$(nPoints),40,90)
print("color = (" +str$(iRed) + "," +str$(iGreen)+ "," + str$(iBlue) + ")",40,110)
label_time=50
endif
r=rnd(1)
if r<=0.01 then
x=0
y=0.16*y
go=true
elseif r<=0.07 then
x = 0.2 * x - 0.26 * y
y = 0.23 * x + 0.22 * y + 1.6
go=true
elseif r<=0.15 then
x = -0.15 * x + 0.28 * y
y = 0.26 * x + 0.24 * y + 0.44
go=true
endif
if go = false then
x = 0.85 * x + 0.04 * y
y = -0.04 * x + 0.85 * y + 1.6
endif
x1 = (x+3)*70
x2 = 700 - y * 70
setpixel (x1,x2)
go=false
endif
endfunction