The BBC, in their first digital literacy project since the 1980's, recently gave Year 7 students (aged 11-12) in the UK a tiny single-board computer called the micro:bit. It has a 5x5 grid of LEDs, two buttons, plenty of sensors, and not much memory (16K) or processing power (16 MHz). Thankfully, that's still plenty enough computer to have some fun with.
To me, the 5x5 LEDs looked like they might display a small game of Snake. All I had to do was figure out the input. I originally used the accelerometer to control the snake by tilting the device, but it lacked the speed and precision of a good Snake game. What I really wanted was a way to move the snake in four directions using the two A/B buttons.
If you know binary, you'll know that two on/off values gives us four possible combinations. Of course, one of the combinations is off/off meaning no buttons are pressed. For this case, I decided it was most natural to have the snake constantly move 'down' until a button is pressed: A goes left, B right, and A+B up.
Despite a slightly odd control layout and tiny display, I found Snake on the micro:bit to be surprisingly playable. As proof, here's a video of me playing a full game. It's converted from a GIF so the timing looks a bit odd. In reality the movement is nice and smooth.
The game clocks in at around 120 lines of Python. To read, I suggest you start with the 'main game loop' at the end of the file.
You can use the Mu editor to flash the above to your micro:bit.