3D Christmas tree with 1021 bytes of JavaScript written
Demo Address: http://js1k.com/2010-xmas/demo/856 (non-Chrome browser will be very card)
The source code is as follows:
<!doctype html>
<TITLE>JS1K, 1k demo submission [856]</title>
<meta charset= "Utf-8"/>
<body>
<canvas id= "C" ></canvas>
<script>
var B = document.body;
var c = document.getelementsbytagname (' canvas ') [0];
var a = C.getcontext (' 2d ');
Document.body.clientWidth; Fix bug in Chrome.
</script>
<script>
Start of submission//
M=math; Q=m.random; J=[]; u=16; T=m.sin; E=m.sqrt;for (o=k=0;x=z=j=i=k<200;) with (M[k]=k?c.clonenode (0): c) {Width=height=k?32:w=446;with (GetContext (' 2d ')) if (k>10|! k) for (' 60px Impact ', v= ' Rgba ('; i=i*u,fillstyle=k?k==13? v+ ' 205,205,215,.15) ': v+ (147+i) + ', ' + (k%2?128+i:0) + ', ' +i+ ',. 5) ': '%23cca ',i<7; ' Beginpath (Fill arc (U-I/3,24-I/2 , k==13?4-(i++)/2:8-i++,0,m.pi*2,1))) (Else for (; X=t (i), y=q () *2-1,d=x*x+y*y,b=e (d-x/.9-1.5*y+1), r=67* (b+1) * (L=K/9 +.8) >>1,i++<W; if (d<1) Beginpath (strokestyle=v+r+ ', ' + (r+b*l>>0) + ', 40,.1) '), MoveTo (u+x*8,u+y*8 ), LineTo (u+x*u,u+y*u), stroke (), for (Y=h=k+e (k++) *25,r=q () *w; p=3,j
End of submission//
</script>
</body>
Author Technical Explanation:
http://www.romancortes.com/blog/how-i-did-the-1kb-christmas-tree/
I feel very inferior to the dongdong in the js1k.