Got a fun program here to share.
I created this to produce a Sierpinski Fractal using the chaos game.
Type this into a program with variable 'a'.
It stores the randomly calculated points under lists x and y using the
inputed number of points.
---
'Define sierpinski(a)
'Prgm
Define x=mat►list(newMat(1,a))
Define y=mat►list(newMat(1,a))
Local prex
Local prey
Local r
prex:=int(rand()*100)
prey:=int(rand()*100)
For n,1,a
r:=int(rand()*3+1)
If r=1 Then
x[n]:= prex/2.
y[n]:= prey/2.
ElseIf r=2 Then
x[n]:=(prex+100)/2.
y[n]:=prey/2.
Else
x[n]:=(prex+50)/2.
y[n]:=(prey+50√3)/2.
EndIf
prex:=x[n]
prey:=y[n]
EndFor
'EndPrgm
---
Run the program with the number of points as 'a'. For example type
sierpinski(3000)
for 3000 point fractal.
Then set up a Graphs page as Scatter Plot under Graph Type with Window
Settings of x and y from 0 (min) to 100 (max).
Graph lists x and y under x and y respectively.
For more info on the Sierpinski Triangle and its chaos game see
http://en.wikipedia.org/wiki/Sierpinski_triangle