snake-terminal

Crates.iosnake-terminal
lib.rssnake-terminal
version0.1.0
created_at2026-01-11 16:56:33.373837+00
updated_at2026-01-11 16:56:33.373837+00
descriptionA terminal Snake game written in Rust using Ratatui
homepagehttps://github.com/traitimtrongvag/predator-snake-rs
repositoryhttps://github.com/traitimtrongvag/predator-snake-rs
max_upload_size
id2036094
size4,219,947
PhucAnn (traitimtrongvag)

documentation

README

Snake Terminal

Rust License

A terminal screensaver featuring an autonomous snake that hunts for food using pathfinding algorithms.

Description

Snake Terminal is a visual terminal application where a green snake automatically navigates to consume red food pellets. Built with Ratatui, it provides an aesthetic terminal interface suitable for entertainment or as a live screensaver.

The snake uses BFS pathfinding to intelligently navigate around obstacles, creating smooth and realistic movement patterns.

Features

  • Autonomous snake with intelligent pathfinding
  • Clean terminal UI with minimal design
  • Configurable max score for auto-reset
  • Real-time score tracking
  • Smooth animations at 80ms tick rate

Dependencies

  • ratatui 0.26 - Terminal UI framework
  • crossterm 0.27 - Terminal manipulation
  • rand 0.8 - Random number generation

Installation

git clone https://github.com/traitimtrongvag/predator-snake-rs.git
cd predator-snake-rs
cargo build --release

Usage

Run with default settings (max score: 50):

cargo run --release

Run with custom max score:

cargo run --release -- 100

Press q to quit.

Configuration

Speed can be adjusted in src/main.rs:

let tick_rate = Duration::from_millis(80); // Lower = faster

Demo

Snake Demo

License

MIT

Commit count: 11

cargo fmt