Skip to content

Releases: RetroDev256/micro_snake

745 Bytes

17 Feb 07:28
Compare
Choose a tag to compare

Been a while since the snake has been this small!
Only thing that has been fully removed is the "Len:" part of the score (don't worry! you can still see how long you are)

The RNG has been changed to the same LCG that VMS's MTH$RANDOM uses, saving a few bytes, yet still good enough for the game. The banner has been changed, and re-used as the death animation.

Getting closer to 0 bytes! ;)

815 Bytes

17 Feb 03:29
Compare
Choose a tag to compare

Rexicon (Sinon) reminded me I could get rid of the frame pointer to save some extra bytes - it worked!

845 Bytes

13 Feb 00:40
Compare
Choose a tag to compare

Shuffled things around and it got smaller :)

859 Bytes

12 Feb 20:38
Compare
Choose a tag to compare

For a while, zig sucked. Then I found out that the binary size was related to statically linking compiler_rt, so I yeeted it, and implemented the missing functions. I then realized that I was resetting the termios when I didn't need to. I found a few more bits and bobs that could be tweaked, and here we go :)

After some pain with linker scripts in the recent past, I decided I better add an option to compile the program without RWX PHDRS, so that it could theoretically run on systems which don't like that type of binary. Anyways, enjoy.

922 Bytes

22 Aug 19:27
Compare
Choose a tag to compare

The snake now looks fancier, and the score is right-aligned (takes up less of the top right corner, looks more balanced, the conversion for u32 code itself is slightly smaller due to this)

912 Bytes

22 Aug 17:46
Compare
Choose a tag to compare

This update has been long waiting. I had not been able to work on this project for 2 years, and finally got back to it. I updated Zig (now on self-hosted), and attempted to build the project. Surprisingly, the project (once compiler errors were fixed) was about 12 KiB. I went down the rabbit hole of creating my own linker script (attempting to remove padding between sections), which helped the binary (seems like Zig linked differently back in the day). Unfortunately, 8 KiB was still way too much. After much pain, I realized that this new version of Zig had embedded certain initialized arrays into the binary, instead of executing them at runtime. After that was fixed, I made small incremental improvements to the code and shrunk the size down to 1008 Bytes. This was a bit larger than I had anticipated, and someone on discord was kind enough to let me know about the existence of PHDRS (which I had completely forgotten about). Down the rabbit hole again, the output is now 912 bytes! Woohoo!

997 Bytes

03 Oct 01:04
Compare
Choose a tag to compare

Added an "animation" feature that plays when you die, also added a small banner that stays on the screen for a bit when you first start up the game

799 Bytes

02 Sep 19:18
Compare
Choose a tag to compare

Snake rendering is simpler, sub 800 Bytes

818 Bytes

02 Sep 18:29
Compare
Choose a tag to compare

Now when you try to move in the opposite direction the snake is moving in, the direction won't be set.

781 Bytes

02 Sep 18:15
Compare
Choose a tag to compare

Simplified alignment