See what you can create with 140 characters of JavaScript and a canvas
1–10 of 28 posts
Re: See what you can create with 140 characters of JavaScript and a canvas
#2Re: See what you can create with 140 characters of JavaScript and a canvas
#3Edit: If you hit "New dweet" it tells you.
u(t) is called 60 times per second.
t: Elapsed time in seconds.
S: Shorthand for Math.sin.
C: Shorthand for Math.cos.
T: Shorthand for Math.tan.
R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5)
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
Re: See what you can create with 140 characters of JavaScript and a canvas
#4Where is the Javascript running, the backend or the in my browser?
Re: See what you can create with 140 characters of JavaScript and a canvas
#5 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&&jRe: See what you can create with 140 characters of JavaScript and a canvas
#6These all assume certain variables are pre-defined but nowhere does it say what they are. Edit: If you hit "New dweet" it tells you. u(t) is called 60 times per second. t: Elapsed time in seconds. S: Shorthand for Math.sin. C: Shorthand for Math.cos. T: Shorthand for Math.tan. R: Function that generates rgba-strings, usage ex.: R(255, 255, 255, 0.5) c: A 1920x1080 canvas. x: A 2D context for that canvas.
they could shorten every setter and function so c.width could just be w() or c.w= and c.fillStyle could just be fs(style) or c.fs=
They arbitrary shorten somethings but not others seems well... arbitrary
Re: See what you can create with 140 characters of JavaScript and a canvas
#7Re: See what you can create with 140 characters of JavaScript and a canvas
#8Well, 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
Re: See what you can create with 140 characters of JavaScript and a canvas
#9Well, 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
Re: See what you can create with 140 characters of JavaScript and a canvas
#10Well, 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
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&&ja-j),n/2+j-a,b),fillText(j%9,i,j)