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.
remix of d/79 by u/iverjo

function u(t) {

}//
133/140


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

  • Golfed version (120 characters): c.width=960;for(i=2e3;i--;)b=2.79*i+t,x.fillRect(480+460*S(a=i/42)*S(b),270+160*(C(a)+T(t/9+a)),s=7/(S(a)*S(b+4.7)+2),s)
  • u/iverjo
    118 characters: c.width=960;for(i=2e3;i--;)x.fillRect(480+460*S(d=i/42)*S(b=2.79*i+t),270+160*(C(d)+T(t/9+d)),s=7/(S(d)*S(b+4.7)+2),s)
  • u/iverjo
    115 characters: c.width=960;for(i=2e3;i--;)x.fillRect(480+460*S(d=i/42)*S(b=2.79*i+t),270+160*(C(d)+T(t/9+d)),s=7/(-S(d)*C(b)+2),s)
  • u/iverjo
    114 characters: c.width=960;for(i=2e3;i--;)x.fillRect(480+460*S(d=i/42)*S(b=2.79*i+t),270+160*(C(d)+T(t/9+d)),s=7/(S(d)*C(b)+2),s)

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)