Sierpinski fractal maker sample
Posted: Sat Mar 23, 2013 9:34 pm
rem Sierpinski fractal maker
def screenwidth=screen_width()
def screenheight=screen_height()
x=ScreenWidth/2
y=ScreenHeight/2
graphics
loop:
r=rnd(3)+1
ux=ScreenWidth/2
uy=0
IF r=1 THEN
ux=0
uy=ScreenHeight
ENDIF
IF r=2 THEN
ux=ScreenWidth
uy=ScreenHeight
ENDIF
x=(x+ux)/2
y=(y+uy)/2
z=rnd(1)
draw COLOR z,x/ScreenWidth,y/ScreenHeight
draw Pixel x,y
GOTO loop
This is because mr. kibernetik likes fractals. It was lifted and modified from the misoft forum. I own both programs. This one is faster in this snippet. In all fairness you need to set the point size to one on the misoft version.
Enjoy
Dale
def screenwidth=screen_width()
def screenheight=screen_height()
x=ScreenWidth/2
y=ScreenHeight/2
graphics
loop:
r=rnd(3)+1
ux=ScreenWidth/2
uy=0
IF r=1 THEN
ux=0
uy=ScreenHeight
ENDIF
IF r=2 THEN
ux=ScreenWidth
uy=ScreenHeight
ENDIF
x=(x+ux)/2
y=(y+uy)/2
z=rnd(1)
draw COLOR z,x/ScreenWidth,y/ScreenHeight
draw Pixel x,y
GOTO loop
This is because mr. kibernetik likes fractals. It was lifted and modified from the misoft forum. I own both programs. This one is faster in this snippet. In all fairness you need to set the point size to one on the misoft version.
Enjoy
Dale