# chynl/snake

Playing the game of snake with AI.

Repository: https://github.com/chynl/snake
Canonical: https://ross.abutalabs.com/products/snake
Language: Python
License: MIT
License Family: permissive
Topics: snake, game, artificial-intelligence, graph-theory, algorithm, python, deep-reinforcement-learning, reinforcement-learning, ai, snake-ai
Last push: 2026-04-19T20:37:04+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 78, release rhythm 35, longevity 100
- inputs: {"age_days": 3721, "days_push": 136, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1787, forks 578 (observed 2026-08-28T04:05:36.271481+00:00)

## What it is
A Python application that plays the game of Snake using two AI approaches: a graph-search algorithm based on Hamiltonian paths and shortest paths, and a deep reinforcement learning model trained with PyTorch. It includes a pre-trained model and training scripts, running on CPU or GPU.

## Use cases
- play snake with an AI agent
- train a reinforcement learning model to play snake
- learn graph search algorithms for games
- compare rule-based AI vs reinforcement learning
- study Hamiltonian path strategies in snake
- experiment with deep RL in a simple game environment

## When to choose
- you want a well-documented, benchmarked snake AI with both graph search and RL approaches
- you want a simple environment to learn or teach reinforcement learning
- you want a ready-to-run demo with a pre-trained model

## When to avoid
- you need a production game or a general-purpose RL framework
- you want a graphical game engine beyond the snake demo
- you need environments other than snake

## Facets
- artifact type: application
- maturity: active
- function: game, reinforcement-learning, machine-learning, simulation
- domain: artificial-intelligence, reinforcement-learning
- platform: python, cross-platform, cli
- tags: snake-game, graph-search, hamiltonian-path, deep-reinforcement-learning, pytorch, ai-agent, game-development, algorithms

## Member repositories
- chynl/snake (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:36.271481+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:23:28.637686+00:00, confidence not recorded.
  - readme: https://github.com/chynl/snake (fetched 2026-08-28T04:05:36.271481+00:00, sha 6e80c84947a6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
