dwitter.net

+ New dweet
function u(t) {
} //
122/140


Please log in (or register) to post a dweet (copy-paste the code somewhere safe to save it meanwhile)


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.
show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
140/140


Please log in (or register) to post as a new dweet (copy-paste code somewhere safe to save it meanwhile).

  • d/25779 randomized arrangement in taupe
  • Show more comments…
  • u/eyaler
    i love it, but noob question - the decoded string is the same length. so why encode?
  • u/eyaler
    z=.61+Math.random()/1e3;for(m=t?0:2e4;m-->1e4;x.fill())x.beginPath(x.fillStyle=R(j=m**(g=m%z),j*.8,j*.75,q=S(m)**4)),x[q>.5?'arc':'rect']((m%13-.5)*160,(j|0)%9*135,40/q,j,j-z/g)
  • u/taupelink
    thank you! i think it's 177 chars when uncompressed
  • u/tomxor
    The funny thing is that it's actually much much longer when you count in bytes. The uncompressed is 178 bytes because it's pure ASCII and the compressed is 319 bytes due to all the multi-byte unicode. (you can get the UTF8 encoded byte length using new TextEncoder().encode('code').length

Please log in (or register) to comment.

u(t) is called 60 times per second. t: elapsed time in seconds. c: A 1920x1080 canvas. x: A 2D context for that canvas. S: Math.sin C: Math.cos T: Math.tan R: Generates rgba-strings, ex.: R(255, 255, 255, 0.5)