Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Barnsley's Fern

Name: Anonymous 2009-06-13 17:31

Minimal Barnsley's Fern (lolwikipedia) in html and javascript:

<html><script>n=u=v=0
function i(){t=document.body.lastChild.getContext('2d')
t.fillStyle='green'
r=Math.random()*99
x=u,y=v
u=x*.85+y/25,v=y*.85-x/25+1.6
if(r<14)u=y/3-x/7,v=x/4+y/4+.4
if(r<7)u=x/5-y/4,v+=1.3
if(r<1)u=0,v=y/6
t.fillRect(50*u+140,525-50*v,1,1)
if(n<2e5)if(n++%99)i()
else setTimeout(i,1)}onload=i</script><canvas height=550></html>


Works on modern browsers (well, ok, works on Firefox and probably Chrome). It's also 348 bytes. Can anyone do better?

Name: Anonymous 2009-06-23 14:18

>>81
than

url:
data:text/html;charset=utf-8,<canvas height%3D550 onclick%3Dn%3Du%3Dv%3D0%2Ct%3DgetContext('2d')%2Ct.fillStyle%3D'%23070'%3Bi%3Dfunction(){r%3DMath.random()*99%3Br<14%3Fr<1%3F(u%3D0%2Cv/%3D6)%3Av%3Dv/4+u/4+(r<7%3F(u%3Du/5-v/4%2C85)%3A(u%3Dv/3-u/7%2C30))%3Au%3Du*.85+v/25+0*(v%3Dv*.85-u/25+80)%3Bt.fillRect(u+140%2C525-v%2C1%2C1)%3Bn++<2e5%3Fn%2599%3Fi()%3AsetTimeout(i%2C1)%3A1}%3Bi()>

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List