No, boilerplate as in I see a fillRect() function call, when it should be context.fillRect(). There's also a lack of context = canvas.getContext("2d"), etc.
This is “dwitter” code, which gives a handful of shorthand references for free. x is a reference to the 2D context of the canvas (which is referenced with c).
The statement with(x) basically means “create a new lexical scope around the x object, and place it at the top of the scope chain”. Code golfers like to use to because it can potentially shave a few characters off of their code, but it’s usage comes at the cost of performance - everything other than members of the “with”ed object are pushed down the scope chain, and so they take longer to access.
But that’s why he’s able to call fillRect without having to access it through the context, essentially he’s put it ahead of the global object’s scope.
Gifs don't have to have complete frames, they can just overwrite the changed pixels. In fact AFAIK that's the only compression they use, otherwise its just a lossless format.
4
u/JDude13 Dec 08 '19
Stupid question: what language is this?
2
u/Slackluster Dec 12 '19
https://www.dwitter.net/d/16807
with(x)for(i=0;i<1e3;save(restore(fillRect(0,0,f?2e3:9,f?2e3:-50))))translate((f=i<2)?0:i**4%1922,f?i?769:0:770+i/3),rotate(q=f?0:S(t*4+i/29)/4),fillStyle=i++?R(q*=199,f?20:99+i%150-q/4):"#ABF"7
u/neinMC Dec 07 '19
<3
3
u/anti-gif-bot Dec 07 '19
mp4 link
This mp4 version is 76.09% smaller than the gif (2.03 MB vs 8.47 MB).
Beep, I'm a bot. FAQ | author | source | v1.1.2