A high-performance, minimalist Snake game written in Rust using only std and libc. No game engines, no bloated dependencies just raw terminal manipulation.
This project was built with a "stripped-to-the-metal" philosophy. Instead of relying on high level crates like ncurses or crossterm, Snakers interfaces directly with the Unix C library to handle terminal behavior.
- Zero External Dependencies: Only uses the Rust
stdlibrary andlibcfor system calls. - Raw Mode I/O: Manually manipulates
termiosstructures to disable canonical mode and echo. - Non-blocking Input: Efficiently polls for keystrokes without halting the game loop.
- Manual Bitwise Flags: Uses raw bitwise logic (
!,&,|) to manage terminal state, just like classic C systems programming.
- Direct FFI: Interfaces with
tcgetattrandtcsetattrvialibcfor low-latency input. - Memory Efficient: Extremely tiny binary footprint with zero-cost abstractions.
- Escape Sequences: Uses ANSI escape codes for screen clearing and cursor positioning.
Since there are no dependencies, you just need the Rust toolchain:
git clone [https://github.com/harshvsri/snakers](https://github.com/harshvsri/snakers)
cd snakers
cargo run --release