A snake clone for terminals written from scratch without any libraries
Implementing snake in the terminal would probably be much easier with something like ncurses, but I wanted to see how far I'd get by only using ansi escape codes.
Tested on GNU/Linux, macOS and WSL and it works surprisingly well.
$ make && ./cnake
To build a debug version that logs to debug.out, run make DEBUG=1
.
Use h, j, k and l to move around, just like in Vim. Arrow keys are also supported, if you prefer that.
- Draw game on fullscreen surface
- Handle user input to control snake
- Game loop that moves snake and redraws
- Collision detection
- Statusbar with score and other useful stuff
- Fancy mode with unicode characters
See issues for more details.