24 comments

[ 2.4 ms ] story [ 67.0 ms ] thread
Pretty cool, but also pretty unplayable (mainly due to the high speed of the snake) :D
Skill issue. But I also agree. It's crazy fast.
4.77MHz ought to be enough for anybody
Just press the turbo button, to turn off turbo.
Can we still overclock the cpu by connecting two pins on the motherboard with jumper connectors?
Need to add 100x bytes of padding operations to slow it down
Just reduce the CPU cycles in DOSBox
I played the webassembly version in the browser
Definitely not fast for me, actually it lags a lot and I have to press keys well in advance to steer the snake into the food. Or is it so fast that I'm seeing only one frame every few hundreds and it moves almost one full screen between each position I can see?
In 1998 Assembly programmers who typically participated in Demo competitions did a series of size coding challenges. The first one was a Snake game (Nibbles), all in a DOS environment. The winning entry was 48 bytes long.

https://hugi.scene.org/compo/compoold.htm#compo1

There were also some creative attempts that took less than 48 bytes and got disqualified. One of those encode the entire game in a series of empty folders using the folder names.

Edit: the original Hugo size coding competitions were created by Claus-Dieter Volko (Alias: Adok).

Edit: Typos

the winning 48-byte entry isn't really snake (nibbles), as the length of the snake grows with every move, rather than with every bit of food consumed. looks more like tron.
I got to a size-5 snake and it stopped giving me apples. Cool though.
Always love these projects with restrictions, they remind me of .kkrieger(https://en.wikipedia.org/wiki/.kkrieger), an insanely tiny FPS.

I had also never seen a source code example for running an HTML embedded DOSBOX, so that was pretty interesting too.

Neat! Its pretty fast and restarts when you press the opposite arrow from where you are going - nerve wracking..
I would enjoy these posts more if they actually documented how the game implementation works, rather than just dumping an assembly file for the reader to figure out.

Also, I don't find “fits into a QR code” all that impressive. QR codes can contain kilobytes of data (see: COVID certificates), which is considered a lot in the demo scene (e.g. Google "256B demo" to see some really impressive examples). I bet you could implement a fully graphical Snake clone in less than 1024 bytes.

Somehow got 2 on mobile after way more trying than I’d like to admit
Pressing the direction you are going makes it stutter

Pressing opposite direction kills you

Inputs aren't buffered so fast inputs are either dropped or kill you

Sometimes the snake just randomly grows??

Not a very good implementation

I noticed all these same things as well. It still is impressive but not what I would call a playable game.
Reminds me of the old Beagle Bros 1-line BASIC programs.
in dosbox it seems to run too fast to be playable and then hang

is this the right file?

    00000000: 6800 b81f b9a0 0fb8 0300 cd10 bfd0 078d  h...............
    00000010: 76fc 0faf dd21 cb38 2f74 f788 0fe4 60bb  v....!.8/t....`.
    00000020: 0400 241e 7a02 88cb 2414 7402 f7db 29df  ..$.z...$.t...).
    00000030: 39cf 77d3 d1fb 8d41 02f6 f120 e474 c838  9.w....A... .t.8
    00000040: 2d74 c489 7e00 4545 380d 882d 74c4 26ad  -t..~.EE8..-t.&.
    00000050: 9388 27eb c8                             ..'..
oh i guess with `dosbox -c 'cycles 1' .` it's playable actually

i suspect it will still eventually hang tho

Doesn't run well on DOSBox-X. Gave me lots of these: "LOG: 6454305 ERROR CPU:Illegal Unhandled Interrupt Called 0"

I'm on Intel Mac, btw.