Thanks to visit codestin.com
Credit goes to github.com

Skip to content

harshvsri/snakers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snakers 🐍

A high-performance, minimalist Snake game written in Rust using only std and libc. No game engines, no bloated dependencies just raw terminal manipulation.

The "No-Frills" Architecture

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 std library and libc for system calls.
  • Raw Mode I/O: Manually manipulates termios structures 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.

Technical Highlights

  • Direct FFI: Interfaces with tcgetattr and tcsetattr via libc for 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.

Installation & Running

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

About

Rust implementation of the OG snake game using only std and termios bindings

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages