{"id":49914675,"url":"https://github.com/canreader/snaketermrs","last_synced_at":"2026-05-16T15:10:36.553Z","repository":{"id":339204763,"uuid":"1160903217","full_name":"CanReader/SnakeTermRS","owner":"CanReader","description":"Terminal Snake game written in Rust","archived":false,"fork":false,"pushed_at":"2026-02-18T14:55:37.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-18T18:31:57.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CanReader.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-18T14:05:13.000Z","updated_at":"2026-02-18T14:57:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/CanReader/SnakeTermRS","commit_stats":null,"previous_names":["canreader/snaketermrs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/CanReader/SnakeTermRS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FSnakeTermRS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FSnakeTermRS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FSnakeTermRS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FSnakeTermRS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CanReader","download_url":"https://codeload.github.com/CanReader/SnakeTermRS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CanReader%2FSnakeTermRS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33107648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-16T15:10:23.280Z","updated_at":"2026-05-16T15:10:36.545Z","avatar_url":"https://github.com/CanReader.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SnakeTermRS\n\nA feature-rich terminal Snake game written in Rust.\n\n![Rust](https://img.shields.io/badge/language-Rust-orange)\n![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-blue)\n![License](https://img.shields.io/badge/license-MIT-green)\n\n```\n  ╔═══════════════════════════════╗\n  ║     SNAKE — Terminal Edition  ║\n  ╚═══════════════════════════════╝\n```\n\n## Features\n\n- Colored rendering (green snake, yellow head, red food)\n- Singleplayer and local multiplayer (2 players, same keyboard)\n- Start menu with high score display\n- Pause / resume\n- Progressive speed (gets faster as you grow)\n- Bonus food (`$`) that spawns randomly for extra points\n- Random obstacles / walls\n- Shrinking border mode\n- Death animation\n- Wrap-around (borderless) mode\n- Inverted controls mode\n- Auto-restart mode\n- Dynamic map sizing (auto-detects terminal size)\n- Input buffering (queue up to 3 fast turns)\n- High score persistence\n- Game recording and replay\n- TOML config file support\n- Fully configurable glyphs, speed, and RNG seed\n- Terminal bell on food eat and death\n\n---\n\n## Build\n\nRequires [Rust](https://rustup.rs/) (1.70+).\n\n```bash\ncargo build --release\n```\n\n## Run\n\n```bash\n./target/release/snake-term\n```\n\n---\n\n## Controls\n\n| Key | Action |\n|-----|--------|\n| `W A S D` | Move (Player 1) |\n| `Arrow keys` | Move (Player 1, or Player 2 in multiplayer) |\n| `P` / `Space` | Pause / Resume |\n| `Q` / `Esc` | Quit |\n| `R` | Restart (on game over) |\n| `M` | Back to menu (on game over) |\n| `Ctrl+C` | Force quit |\n\n---\n\n## Command-line options\n\n```\nUsage: snake-term [OPTIONS]\n\nOptions:\n      --speed \u003cms\u003e               Frame delay in milliseconds [default: 200]\n      --body \u003cchar\u003e              Snake body character [default: @]\n      --head-w \u003cchar\u003e            Head glyph moving west [default: \u003c]\n      --head-n \u003cchar\u003e            Head glyph moving north [default: ^]\n      --head-e \u003cchar\u003e            Head glyph moving east [default: \u003e]\n      --head-s \u003cchar\u003e            Head glyph moving south [default: v]\n      --head \u003c4chars\u003e            All 4 head chars as WNES (e.g. '\u003c^\u003ev')\n      --food \u003cchar\u003e              Food glyph [default: *]\n      --seed \u003cnum\u003e               RNG seed, 0 = random [default: 0]\n      --hide-score               Hide the score display\n      --auto-restart             Auto-restart on game over\n      --invert-controls          Invert movement directions\n      --disable-borders          Enable wrap-around\n      --obstacles \u003cnum\u003e          Number of random walls [default: 0]\n      --multiplayer              Enable 2-player mode\n      --progressive-speed        Speed increases as snake grows\n      --shrinking-border         Play area shrinks over time\n      --map-width \u003cnum\u003e          Map width, 0 = auto [default: 0]\n      --map-height \u003cnum\u003e         Map height, 0 = auto [default: 0]\n      --config \u003cpath\u003e            Load settings from a TOML file\n      --record \u003cpath\u003e            Record game inputs to a file\n      --replay \u003cpath\u003e            Play back a recorded game\n  -h, --help                     Print help\n```\n\n---\n\n## Examples\n\n```bash\n# Classic game\nsnake-term\n\n# Fast game with custom glyphs\nsnake-term --speed 100 --body '#' --head '\u003c^\u003ev' --food '@'\n\n# 2 players with obstacles\nsnake-term --multiplayer --obstacles 10\n\n# Challenge mode: fast, shrinking, no borders\nsnake-term --progressive-speed --shrinking-border --disable-borders\n\n# Auto-restart for high score grinding\nsnake-term --auto-restart --speed 150\n\n# Record a game, then replay it\nsnake-term --record my_game.rep --seed 42\nsnake-term --replay my_game.rep --seed 42\n\n# Use a config file\nsnake-term --config settings.toml\n```\n\n---\n\n## TOML config file\n\nInstead of passing flags every time, create a `settings.toml`:\n\n```toml\nspeed = 150\nbody = \"#\"\nfood = \"@\"\nobstacles = 5\nprogressive_speed = true\ndisable_borders = true\nmap_width = 30\nmap_height = 20\n```\n\nThen run with:\n\n```bash\nsnake-term --config settings.toml\n```\n\nCLI flags override config file values.\n\n---\n\n## Multiplayer\n\nRun with `--multiplayer` for local 2-player on the same keyboard:\n\n- **Player 1**: `W A S D`\n- **Player 2**: `Arrow keys`\n\nPlayers spawn on separate rows. Colliding with the other snake's body kills you.\n\n---\n\n## Project structure\n\n```\nsrc/\n├── main.rs        Entry point, game loop, menus\n├── config.rs      CLI parsing, TOML config, constants\n├── snake.rs       Snake state, movement, collision\n├── game_map.rs    Grid rendering, walls, bonus food\n├── input.rs       Keyboard input handling\n├── highscore.rs   High score persistence\n└── replay.rs      Game recording and playback\n```\n\n---\n\n## Tests\n\n```bash\ncargo test\n```\n\nCovers snake movement, collision, wall hits, wrap-around, food eating, direction queue, and reset logic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanreader%2Fsnaketermrs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanreader%2Fsnaketermrs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanreader%2Fsnaketermrs/lists"}