Skip to content

typesafe-snake

Real-time Snake autoplayer where code generates legal moves and facts and Jev picks one Choice per tick.

Appprototype

Overview

jev plays snake is a small web app where Jev plays Snake in real time. Code generates the legal moves and exact facts about each one, such as distance to food, reachable cells via flood fill and dead ends, and Jev picks a move with a single Choice question per step. If the answer misses the tick deadline, the snake keeps going straight.

A fixed-clock controller asks Jev at the start of a tick and plays whatever arrived by the end. The API key lives only in a Hono proxy, and the dark dashboard shows the board, strategy presets, current decision and a decision feed. Engine and controller tests are included.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich legal move should the snake take this tick?(inferred)up · down · left · right

How it works

  1. Code computes legal moves with food distance, flood fill and dead-end facts.
  2. At tick start, ask Jev one Choice question.
  3. At tick end, play the answer or continue straight if late.
  4. Update the dashboard and decision feed.

Strengths

  • Illegal moves impossible by construction.
  • Deadline fallback keeps the game real-time.
  • Tests for engine and controller.

Caveats

  • Toy game demo.
  • Requires a TypeSafe key.

Getting started

cp .env.example .env (set TYPESAFE_API_KEY), pnpm install, pnpm dev

At a glance

Type
App
Status
prototype
Language
TypeScript
Runtime
web app + Hono proxy
Has code
yes
Has tests
yes

Use cases and integrations

How curated lists describe it

Frequently asked questions

What does Jev decide?

Which legal move to take each tick.

What if Jev is too slow?

The snake keeps going straight for that tick.

Where is the API key kept?

Only in the Hono proxy server.

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.

    ProjectproductionTypeScript
  • Browser 1v1 sniper arena where Jev reads match state about 9 times a second and chooses movement, aim, ADS, firing and jumping.

    ServicebetaTypeScript
  • Instrumented 2048 web lab where every move is a Jev Choice over four directions, with probabilities, latency and cost shown live.

    ProjectbetaTypeScript
  • Fifteen live arcade games where Jev and LLMs play each other, led by WikiRace in which Jev picks only real links.

    ProjectbetaTypeScript
  • Real-time bot battles where you write a fighter's strategy in plain English and a System One model pilots it several times a second.

    ProjectbetaTypeScript
  • Browser extension that lets Jev, local Laya or an OpenAI-compatible model take over a running ra2web (WannaFire) RTS match.

    ProjectbetaTypeScript