Get the latest tech news

Four integers are enough to write a Snake Game


A snake written in 4 integers

After not implementing a game of snake in ages, I’ve decided to do my best today, but with some strange and absurd limitations in mind, you know, to spice up things: Because there’s no standard C-way of interacting with the keyboard, I will have to rely on curses, so if you want to compile the program, make sure you have the lib installed on your system. Unfortunately, curses uses additional memory by itself, but let’s be honest, hacking with arcane escape chars and low level system functions is not fun, and certainly not something that I am willing to try by myself.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Integers

Integers

Photo of snake game

snake game

Related news:

News photo

Snake Game in 56 Bytes

News photo

Microprocessor's Romance with Integers

News photo

SDL3 Library Adds A Built-In Snake Game