1 | function g(x){for (c=[],f=[1,0],i=0;i<x;i++){c.push(f.reverse()[0]+=f[1])}return c} |
1 | function a(){for(i=1,s=0;i<10;i++){d='',n=0;while(n++<i)d+=i;s+=+d}return s} |
1 | function a(){for(s=0,i=9;i;)s+=+Array(i+1).join(i--);return s} |
1 | function a(s=0){for(i=9;i;)s+=+Array(i+1).join(i--);return s} |
1 | for(s=0,i=9;i;){s+=+Array(i+1).join(i--)}alert(s) |
Quote from xenApr 25, 2014 - 13:11:44
*EDIT*
#2 49 chars
GeSHi`ed javascript code
1 for(s=0,i=9;i;){s+=+Array(i+1).join(i--)}alert(s)
1 | x=prompt();for (c=[],f=[1,0],i=0;i<x;i++){c.push(f.reverse()[0]+=f[1])}alert(c) |
1 | p=prompt(z=[0]);for(x=e=n=1;n<p;n++){z.push(x);[x,e]=[e,x+e]}alert(z) |
1 | p=prompt(z=0);for(x=e=n=1;n<p;n++){z+=','+x;[x,e]=[e,x+e]}alert(z) |
1 | p=prompt(x=e=n=z=1);for(;n<p;z+=','+e,[x,e]=[e,x+e])n++;alert(z) |
1 | for(s=0,i=9;i;s+=+Array(i+1).join(i--));alert(s) |