Live data from Hacker News

See what you can create with 140 characters of JavaScript and a canvas

dwitter.net

21–28 of 28 posts

Re: See what you can create with 140 characters of JavaScript and a canvas

#22
post #10
post #5

Well, I have done just about all I can to do to make the Matrix digital rain, but I am sadly 100 bytes over. I am out of time to kill, but if you aren't, please take this off of my hands. :) with(x)for(fillStyle="#000",fillRect(0,0,1e4,1e4),font="32px m",i=0;1920>i;i+=32)for(j=0,a=((2166136261*i^16777619)+960*t)%2160;b=255*(32>a-j),1080>j&&j

174 it feels close. I dropped the text and went with numbers. (sorry for any duplicate notification spam) with(x)for(fillStyle="#000",font="2em m",fillRect(i=0,o=32,n=1920,n);n>i;i+=o)for(j=0,a=((2e7*i^1e9)+n*t)%n;n>j&&j a-j),n/2+j-a,b),fillText(j%9,i,j)

145

   for(x.fillRect(i=0,0,n=c.width=540,n);n>i;i+=o)for(o=12,j=0,a=((n*i^1e7)+n*t)%n;ja-j),n/2+j-a,b),x.fillText(j%9,i,j)

Re: See what you can create with 140 characters of JavaScript and a canvas

#25
post #20

Are there any tutorials for getting started with this?

Demoscene competitions.

Check tutorials for 64 KB, 4 KB and such.

Think of 140 characters as trying to do 140 byte executables.

The basic idea is to first create whatever you want to achieve, without thinking too much about the size.

Then you iterate the algorithm, reducing the size until it achieves the desired goal.

In the process it helps to make use of typical demoscene technics, namely packers/minifiers, procedural generation.

Re: See what you can create with 140 characters of JavaScript and a canvas

#28
post #22
post #10

Earlier quoted context omitted.

174 it feels close. I dropped the text and went with numbers. (sorry for any duplicate notification spam) with(x)for(fillStyle="#000",font="2em m",fillRect(i=0,o=32,n=1920,n);n>i;i+=o)for(j=0,a=((2e7*i^1e9)+n*t)%n;n>j&&j a-j),n/2+j-a,b),fillText(j%9,i,j)

145 for(x.fillRect(i=0,0,n=c.width=540,n);n>i;i+=o)for(o=12,j=0,a=((n*i^1e7)+n*t)%n;j a-j),n/2+j-a,b),x.fillText(j%9,i,j)

140 :)

https://www.dwitter.net/d/10398

Post reply on HN