jev-tetris
Self-playing web Tetris where Jev picks each placement from code-computed board facts, showing probabilities, latency and cost.
Overview
Jev plays Tetris is a small Node web app where TypeSafe's Jev plays by itself; the only control is Reset. For each new piece, code lists every reachable placement (rotate, shift, drop) and computes plain facts about the resulting board: lines cleared, new holes, stack height, bumpiness and piece top height. These candidates go to Jev as a single typed Choice; there is no hand-tuned scoring formula, so Jev weighs the trade-offs.
The page animates the chosen placement and shows Jev's top candidates with probabilities, the choice confidence, the latency and the cost of each call, plus a running total for the game. The game waits for Jev before moving each piece, so latency never ends a game. Cost is computed from reported input tokens at the listed $0.042 per million. The key stays on the local server, game logic is pure and unit-tested with node:test, and the project is MIT licensed.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Which reachable placement should this piece take? | — |
How it works
- Enumerate reachable placements and compute board facts
- Send candidates to Jev as one Choice
- Animate the chosen moves
- Display probabilities, confidence, latency and cost
Strengths
- No hand-tuned heuristic; the model weighs trade-offs
- Per-call latency and cost displayed
- Pure, unit-tested game logic
Caveats
- Game waits for each answer, so it does not test real-time play
- No performance results reported
Getting started
npm install && TYPESAFE_API_KEY=<key> npm start, then open http://localhost:3000.At a glance
- Type
- Project
- Status
- prototype
- Language
- JavaScript
- Runtime
- Node + browser
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Tetris that plays itself: TypeSafe's Jev model picks every placement with one typed Choice call, with live probabilities, latency, and cost.
logicrw/awesome-jev-projects
Frequently asked questions
Is there a scoring formula?
No. Code only computes board facts; Jev weighs them in its choice.
How much does a game cost?
The page shows a running total computed from input tokens at $0.042 per million.
Can latency make it lose?
No, the game waits for each decision before moving the piece.
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