Skip to content

jev-2048-selenium

Selenium bot that plays 2048.org by fusing expectimax search with a Jev Choice over legal moves on every turn.

Projectprototype

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

TypeQuestionAnswers
ChoiceWhich legal move is best given the board and search evidence?up · down · left · right

How it works

  1. Read the 4x4 board from the site's saved state
  2. Compute legal moves and expectimax evaluations
  3. Send Jev a Choice over legal moves with evidence
  4. Fuse Jev's distribution with search, weighted by confidence
  5. 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

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.

    ProjectprototypeJavaScript
  • Agent where Jev plays a real online 2048 website through Playwright with one API call per move and no text-generating model.

    ServiceprototypePython
  • Spectator demo where two independent Jev agents play Snake side by side by clicking indexed direction buttons in separate iframe browsers.

    ProjectprototypeTypeScript
  • Prebuilt browser, computer-use, robotics and game agents whose actions come from Jev, Laya or Cua-S1, with a scaffold for new agents.

    ProjectbetaPython
  • 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