dwitter.net | metamero (414)

+ 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 fullscreen

function u(t) {

}//
139/140


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

  • metamero: now the right way to count bytes AND characters of a javascript (UTF-16) code

Please log in (or register) to comment.

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

  • metamero: 🐍 #snake 🐍 #GAME 🐍 with death !... wasn't it deadly enough ? 🐍 now with increasing difficulty 🐍 add a space on end of the code to see score 🐍 play on keyboard with WASD 🐍 jogo da cobrinha 🐍 doidera 🐍 things went crazy !
  • Load older comments...
  • metamero: the first apple is fast but is the smallest snake (so it's easier then it looks, i found fun). then it gets from difficulty level 3 to 60.
  • metamero: go on, don't be scared ;) what is your best score?
  • katkip: 879

Please log in (or register) to comment.

show FPS hide FPS share 1 remix fullscreen

function u(t) {

}//
143/140


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

  • metamero: i'm a newcomer, but codegolf community must decide whether they like to count code size in UTF-16 characters, UTF-16 code units or bytes (or bits, since b and B are different units)
  • Load older comments...
  • metamero: speaking about bugs, this code actually counts UTF-8 chars (as they are represented in the page/editor). one can see this matter with the symbol (it's 2B long in UTF-16 but 3B in UTF-8). parameter 'utf-16' in TextEncoder is obsolete, see this note here https://developer.mozilla.org/en-US/docs/W...
  • metamero: d/11906 is my method to count UTF-16 chars
  • metamero: *** this code actually counts bytes of the string encoded with UTF-8 (html context). d/11906 counts bytes of the string encoded with UTF-16 (javascript context). both count Unicode chars (or *code points*) right with Array.from(code).length. this is different from counting *code units* (16-bit unsigned elements).

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

  • metamero: beautiful rendering #gameoflife : reset on click : Math.random initialization : toroidal space (wraparound)

Please log in (or register) to comment.

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

  • metamero: dwitter compressor 3.0 ! pack 194B into 140 char ! adapted from xem

Please log in (or register) to comment.

remix of d/9207 by u/MrM@_S

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

}//
48/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) {

}//
23/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) {

}//
138/140


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

  • metamero: 🐍 #snake 🐍 #GAME 🐍 now with death ! 🐍 play on keyboard with WASD 🐍 jogo da cobrinha
  • katkip: i die wierd
  • metamero: there is this fake-death and the dead-lock-death (pleonastic) hehehe
  • iverjo: Impressive!

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

  • metamero: 🐍 #snake 🐍 #GAME 🐍 now with death ! 🐍 play on keyboard with W A S D 🐍 jogo da cobrinha

Please log in (or register) to comment.

Loading...
Next page