Page 1 of 1

Sierpinski fractal maker sample

Posted: Sat Mar 23, 2013 9:34 pm
by Dalede
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

Re: Sierpinski fractal maker sample

Posted: Sun Mar 24, 2013 5:08 am
by Mr. Kibernetik
Very nice working program!

P.S. for those who will want to upload it to their BASIC using Dropbox, I attach your code as a text file here

Re: Sierpinski fractal maker sample

Posted: Mon Mar 25, 2013 7:14 am
by Mr. Kibernetik
Screenshot of this fractal:
Photo 24.03.13, 11 11 55.png
Photo 24.03.13, 11 11 55.png (220.78 KiB) Viewed 3730 times