jev-2048-selenium
Selenium bot that plays 2048.org by fusing expectimax search with a Jev Choice over legal moves on every turn.
Overview
Jev 2048 Selenium Player is a Python app that opens 2048.org in a real browser and plays automatically. Because Jev 1.13 is a text and JSON decision model rather than a game-tree or vision model, the default hybrid mode reads the exact board from the site's saved state, reproduces the merge and scoring rules locally, removes illegal moves, and runs time-bounded iterative-deepening expectimax over the real spawn distribution (90% twos, 10% fours).
Jev then receives a small structured state and one bounded Choice listing only the legal moves with their search evidence. Its full distribution is fused with the search distribution, with Jev's confidence controlling its weight so an uncertain answer cannot override a clearly better search move. A jev mode gives Jev final authority for experiments, and a search mode runs offline without a key. An integrated Selenium and FFmpeg recorder produces 1080x1920 portrait videos for YouTube Shorts.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Choice | Which legal move is best given the board and search evidence? | up · down · left · right |
How it works
- Read the 4x4 board from the site's saved state
- Compute legal moves and expectimax evaluations
- Send Jev a Choice over legal moves with evidence
- Fuse Jev's distribution with search, weighted by confidence
- Play the move via Selenium and optionally record
Strengths
- Jev can never pick an illegal move
- Confidence-weighted fusion protects against weak model answers
- Offline search mode for testing without a key
Caveats
- Hybrid mode means search, not Jev, does much of the work
- Setup documented for Windows PowerShell
Getting started
Create a venv, `pip install -r requirements.txt`, set TYPESAFE_API_KEY, then `python run.py`.At a glance
- Type
- Project
- Status
- prototype
- Language
- Python
- Runtime
- Selenium with Chrome, Edge or Firefox
- Has code
- yes
Use cases and integrations
How curated lists describe it
Selenium 2048 player powered by expectimax search and TypeSafe Jev, with portrait FFmpeg recording.
logicrw/awesome-jev-projectsSelenium 2048 player powered by expectimax search and TypeSafe Jev, with portrait FFmpeg recording.
hellogumbo/awesome-jev
Frequently asked questions
Does Jev play alone?
By default no; it is fused with expectimax search. Use --mode jev to give Jev final authority.
Why not let Jev read the board directly?
Jev is a text decision model, so the app pre-computes legal moves and search evidence for it.
Can it record videos?
Yes, run with --record to create a 1080x1920 MP4.
Related projects
Jev plays a browser table-tennis game in real time, choosing serve direction, contact angle and pace from structured telemetry.
ProjectprototypeJavaScriptAgent where Jev plays a real online 2048 website through Playwright with one API call per move and no text-generating model.
ServiceprototypePythonSpectator demo where two independent Jev agents play Snake side by side by clicking indexed direction buttons in separate iframe browsers.
ProjectprototypeTypeScriptPrebuilt browser, computer-use, robotics and game agents whose actions come from Jev, Laya or Cua-S1, with a scaffold for new agents.
ProjectbetaPythonSource 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.
ServicebetaTypeScript