nix-snake 0.1.2

A NixOS themed classic snake game with screensaver mode & gameplay mode
# nix-snake â„ī¸đŸ

A lightweight, terminal-based Snake game and screensaver written in Rust.

![snowflake-bounce demo](https://raw.githubusercontent.com/saylesss88/nix-snake/main/assets/demo.gif)

Watch a NixOS Lambda (Îģ) navigate your terminal, consuming snowflakes and
packages in an infinite loop, or take control and play yourself.

**Status: Active Development** 🚧

---

## ✨ Features

- đŸ–Ĩī¸ Screensaver Mode (Autopilot): The snake plays itself using a greedy
  pathfinding algorithm. Perfect for a terminal background.

- 🎮 Seamless Override: Press any arrow key to instantly switch from
  "Screensaver" to "Manual" mode. Press a to switch back.

- â„ī¸ NixOS Themed: The snake head is a Lambda (Îģ), eating snowflakes (❄) and
  packages (đŸ“Ļ).

- 🚀 Performance: Built with pure crossterm for low-latency rendering and
  minimal resource usage.

- 🔄 Infinity Walls: The world wraps around the edges of your terminal.

---

## đŸ“Ļ Installation From Source

Ensure you have Rust and Cargo installed.

```bash
git clone https://github.com/saylesss88/nix-snake cd nix-snake
cargo install --path .
```

crates.io

```bash
cargo install nix-snake
```

Nix:

```bash
nix run github:saylesss88/nix-snake
# If it gives you problems try:
nix run --no-write-lock-file github:saylesss88/nix-snake
```

---

## đŸ•šī¸ Controls

- `a`: Switch to Autopilot (Screensaver) Mode

- `q`/ `Esc`: Quit

- Arrow keys: Start playing

- The speed gets faster with every package/snowflake eaten

- The screen flashes red on death & auto-restarts with a body length of 3