Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / Sierpinski triangle!

Author
Message
ESC
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 22nd Mar 2003 03:34 Edited at: 22nd Mar 2003 03:38
The famous triangle fractal, in 20 line, with funky colors!


do
sync on:sync rate 0:hide mouse:randomize timer():i=50000
set display mode 800,600,16:lock pixels:x#=rnd(800):y#=rnd(600)
for c=1 to 800:ink rgb(40-(0.05*c),40-(0.05*c),40-(0.05*c)),0:line c,0,c,600:next c
for k=1 to i
n#=(rnd(100)):n#=n#/100
if n#<(0.3333333)
x#=0.5*x#:y#=0.5*y#
endif
if (0.3333333)<n# and n#=<(0.6666666)
x#=0.5*(400+x#):y#=0.5*(y#+600)
endif
if (0.6666666)<n#
x#=0.5*(x#+800):y#=0.5*y#
endif
ink rgb(rnd(255),rnd(255),rnd(255)),0:dot x#,600-y#
fastsync
next k
unlock pixels:sync
loop


-ESC

"That's not a bug, it's a feature!"
"When all else fails, read the instructions"
-ESC
Attreid
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 22nd Mar 2003 09:39
it's nice
and I'll see this triangle very soon at school ^^

Bu$herie
How many civilians is he going to kill ? I know that Bush will sit at God's left, next to Saddam.

Login to post a reply

Server time is: 2024-11-23 12:52:12
Your offset time is: 2024-11-23 12:52:12