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
Sierpinski fractal maker sample
- Mr. Kibernetik
- Site Admin
- Posts: 4787
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Sierpinski fractal maker sample
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
P.S. for those who will want to upload it to their BASIC using Dropbox, I attach your code as a text file here
- Attachments
-
- sierpinski.txt
- (360 Bytes) Downloaded 522 times
- Mr. Kibernetik
- Site Admin
- Posts: 4787
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Sierpinski fractal maker sample
Screenshot of this fractal: