dwitter.net | stefano (11999)

+ 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.
Try the new frontend: beta.dwitter.net
Current theme challenge: #Opposites
show FPS hide FPS share 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).

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
125/140


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

Please log in (or register) to comment.

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).

  • an attempt at something like a twister
  • Show more comments…
  • u/joeytwiddle
    That's a very juicy #twister!
  • u/cyhawk
    I teach 9-year-olds programming and used a tidied up version of this to show them how to figure out how something works. They loved it! Thanks! I've added a bit of gap between the strands to make it easier to understand, and I think it looks good. Like Math.max(180*S(a-1.2),0).
  • u/rnbw
    wow, i would have never thought that my recreational programming would be used for educational purposes. glad i was able to help those kids out on their journeys!
  • u/danny@hille.dk
    Just saw this, nice code man! Save 11 b like this: for(c.width=i=300;i--;)for(j=8;j--;x.fillStyle=#f+j*15)x.fillRect(i,99-S(a=t-i/80*C(t+i/99)+j*.9)*40,1,Math.max(40*S(a-1.1),0))

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
119/140


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

  • heh there is some calculations left over from a test with Math.ceil.. (can be lot shorter anyway..)
  • u/magna
    #default
  • u/joeytwiddle
    Just a golf to 112: c.width=1920;for(j=2;j--;)for(i=0;i<9;i++)k=j*2-1,x.fillRect(400+i*100+S(t)*300+k*25*S(t),400+k*300*C(t),52,200)

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen
remix of d/10114 by u/yonatan

function u(t) {

}//
134/140


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

  • We can always use more #quine ...
  • u/DaSpider
    //🍡🍧even🧡💛💚💙more🍅🍉🌍colors🥃🌈😈 << paste

Please log in (or register) to comment.

show FPS hide FPS share fullscreen
remix of d/16500 by u/DataMeta

function u(t) {

}//
117/140


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

  • u/DataMeta
    Nice one. To take it full circle (or square) to d/15628: r=Math.random,a=r(b=r(c=r(l=255))) for(j=576;j--;x.fillStyle=R(a*l,b*l,c*l,r()/5))d=64*r(),z=30-d/2,x.fillRect(j%32*60+z,(j/32|0)*60+z,d,d)
  • u/joeytwiddle
    Mellow: r=()=>(1+S(j**5-t++*3))/2 Darker: r=()=>S(j*j-t++*3)%1

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen
remix of d/11886 by u/katkip

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).

Please log in (or register) to comment.


function u(t) {

}//
123/140


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

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
109/140


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

Please log in (or register) to comment.

show FPS hide FPS share fullscreen

function u(t) {

}//
137/140


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

Please log in (or register) to comment.

Loading...
Next page