snake-jev
Desktop Snake where one Jev call per tick asks nine hazard and food questions for left, straight and right, and Python combines them.
Overview
Snake Jev is a desktop Snake experiment built on an existing p5 Snake game. Each tick, the game's sensors are converted into distances relative to the snake's heading, and one API call asks nine independent questions: wall collision, body collision and food progress for turning left, going straight and turning right. Python combines only Jev's answers, preferring food progress among actions Jev assesses as collision-free, and otherwise choosing the lowest assessed collision risk, with ties favouring lower risk and then straight.
There is no second call and no model move Choice, and code does not inspect the board to correct Jev, so a wrong assessment can kill the snake. One recorded run reached 29 foods in 461 ticks before trapping itself; the README stresses that is one run, not a reliability guarantee, and that the agent detects immediate hazards but does not plan routes. Each tick costs a real request, so a --max-calls flag bounds sessions, and redacted traces are written locally.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Would turning left / going straight / turning right hit a wall? | — |
| Yes / no | Would this move hit the snake's body? | — |
| Yes / no | Does this move make progress toward the food? | — |
How it works
- Sample sensors and convert to relative distances
- Ask nine Noul questions in one call
- Combine answers: food progress among safe moves, else lowest risk
- Apply the move and advance one tick
Strengths
- One call per tick
- Simple, inspectable composition rule
- Bounded sessions with --max-calls
Caveats
- No route planning; can trap itself
- Each tick costs an API call
- Tested only on macOS
Getting started
git clone https://github.com/siroccomask/snake-jev.git && cd snake-jev && uv sync, set JEV_API_KEY in .env, then uv run python sketch.py.At a glance
- Type
- Service
- Status
- prototype
- Language
- Python
- Runtime
- Desktop game (OpenGL)
- Has code
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Snake: hundreds of typed direction decisions per run.
AnotiaWang/awesome-decision-modelsReal-time Snake game driven by parallel Jev assessments, deciding optimal turns in a single API call per tick.
logicrw/awesome-jev-projectsSnake controlled by parallel Jev assessments, with one API call per game tick.
hellogumbo/awesome-jev
Frequently asked questions
What does Jev decide?
Whether each of three moves hits a wall or body and whether it approaches food.
How well does it play?
One recorded run reached 29 foods in 461 ticks before trapping itself.
Can I limit cost?
Yes, --max-calls bounds the session.
Related projects
Source for browser chess and Chess960 where code computes each legal move's facts and Jev picks one per turn as a typed Choice.
ProjectproductionTypeScriptBrowser 1v1 sniper arena where Jev reads match state about 9 times a second and chooses movement, aim, ADS, firing and jumping.
ServicebetaTypeScriptInstrumented 2048 web lab where every move is a Jev Choice over four directions, with probabilities, latency and cost shown live.
ProjectbetaTypeScriptFifteen live arcade games where Jev and LLMs play each other, led by WikiRace in which Jev picks only real links.
ProjectbetaTypeScriptReal-time bot battles where you write a fighter's strategy in plain English and a System One model pilots it several times a second.
ProjectbetaTypeScriptBrowser extension that lets Jev, local Laya or an OpenAI-compatible model take over a running ra2web (WannaFire) RTS match.
ProjectbetaTypeScript