Skip to content

About

Wordle game + explainable solver + strategy lab: entropy, minimax, optimal SALET tree, simulations of all 2,315 answers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🟩🟨⬛ Wordle Lab

Play Wordle, get a solver that explains every guess, and see how 18 strategies compare across all 2,315 answers (and 1,717 Ukrainian ones).

Live demo Release License: MIT
Bun Vue 3 TypeScript Tailwind CSS v4 PrimeVue ECharts

Wordle Lab: a daily game won in two, with the share card, stats and the word's meaning

✨ Features

🎮 Play Daily word with a countdown to the next one, or random games. Hard mode, flip/bounce/confetti animations, stats and the word's meaning. After each game: a per-guess review, how the optimal strategy solves the same word, and a share card with your skill and luck. Your player fingerprint tracks skill and luck over time (stored in your browser). Cards follow the game: before the first guess you see your stats; during a game the possible words and information per guess come first (stats shrink to one line); after it the share card leads. On phones the board and keyboard always come first.
🧭 Assistant Help me now: type your guess, tap the tiles to match your colours, and get the next best word with a plain-language reason (undo, demo, shortcuts, the provably optimal tree). The how-to hides once you have entered a guess. Review a game: paste any result, e.g. ARISE(⬜⬜⬜🟨⬜) CLOTH(⬜⬜🟩🟨⬜). Watch a strategy: pick a word and a strategy and watch it play, optionally next to a second one; Every strategy on this word sits right under the replay, above the long guess-by-guess review. All three use the same per-guess card: bits gained vs expected, the best move by entropy and by the optimal tree, luck, and tips.
🎓 Learn A four-step guide (letters → patterns → entropy → trees), a lesson on playing Small groups in your head (count the answers a guess leaves alone in their colour group; worked example with a scout word), letter and positional frequencies, the top openers (the at-a-glance table first, then the chart), and the Word inspector (all 243 colour patterns of any guess, its entropy and its worst case). The opener-pairs heatmap is under Advanced.
🧪 Strategies One leaderboard of every strategy on every answer, grouped by type (Optimal trees, Lookahead, Greedy heuristics, Letter frequency & staged, Baselines) with the overall rank, a one-line description and the opener of each row: average, gap to the proven optimum, fail % and worst case, with Normal/Hard/Both; Ranked shows one flat list. Tick two rows to Compare them in a head-to-head panel: both strategies with their openers (A always amber, B always blue), the averages and the difference, a bar of the words where A is better / the same / B is better, and the worst case, failures and share of games in ≤ 4 for each side; then the biggest differences and the distributions chart. Lookahead explains the 2-ply strategies (precomputed trees, normal mode only) with the opener and parameter experiments. The Strategy Lab builds a strategy from blocks, with Save as custom strategy right under the builder, so saved strategies show up in the other views. More charts and Web Worker re-runs (cached in IndexedDB) are collapsed.
🔭 Explore The optimal decision Tree, which you can also rebuild from your own starting word (computed in a Web Worker, with a default vs. yours table of average, worst case and the guess distribution, remembered per language), a Flow sankey of how the answer set shrinks, and an Answer map of how hard each word is. On phones, Tree and Flow switch to list drill-downs.
👥 Community Curated links: competitive Wordle (World Wardle, Wordle Dash, The Arena Cup), videos and stories (3Blue1Brown, Alex Selby's proof, how Wordle was made and sold), Discord servers, and notable words from our own simulations: the hardest answers, hard-mode traps and one-letter families like _IGHT, each one click from Watch a strategy.
🇺🇦 Ukrainian EN/UA switch in Settings: the whole interface in Ukrainian (Гра · Асистент · Навчання · Стратегії · Дослідження), Ukrainian word lists, a ЙЦУКЕН keyboard (ґ, є, і, ї), and every strategy simulated on Ukrainian answers.
📖 Word meanings Click any word for its definition (dictionaryapi.dev with Wiktionary as a fallback; UA words link to Горох, СУМ-20 and sum.in.ua).

Every tab and sub-view is a real link, e.g. #tab=explore&view=tree, so you can open views in new tabs and share them. Links from older versions (#tab=solver, #tab=coach, #tab=analytics&view=patterns, …) redirect to their new places. On phones the six tabs are a bottom bar.

Play after a game: share card, stats, word meaning, review, optimal replay, fingerprintStrategy leaderboard grouped by type
Assistant: watch a strategy, every strategy on this word, then the reviewTree built from your own starting word (CRANE) compared with SALET
Compare (light theme): the head-to-head panel, biggest differences, then the chartFlow
Learn: word inspector (light theme)Ukrainian leaderboard

UA on a phone Leaderboard as cards on a phone Tree with a custom starting word and the list drill-down on a phone

🏁 Strategy results

Every strategy plays every answer. Hard = Wordle hard mode (revealed letters must be reused, greens stay in place). Fail = needed more than 6 guesses.

🇬🇧 English (2,315 answers, 12,972 guesses)

Strategy Opener Normal Fail Hard Fail (hard)
Optimal tree (SALET) — Selby, proven SALET 3.4212 0 3.5084 0
Lookahead 2-ply (min expected guesses, precomputed tree) SALET 3.4212 (7920, worst 5) 0 – –
Small groups + entropy (Σ 1/group + 20·H, instant) SALET 3.426 0 3.519 0.26%
Max entropy (any word) SALET 3.434 0 3.524 0.22%
Two-step entropy SLATE 3.446 0 3.553 0.30%
Small groups (Σ 1/group, largest ≤ ⌈n/4⌉) SALET 3.450 0 3.546 0.22%
Lookahead 2-ply safe (98.4% in ≤ 4, precomputed tree) SALET 3.454 0 – –
Min expected size ROATE 3.481 0 3.597 0.22%
Explore 2 → candidates (Ruslan balanced) SOARE 3.515 0.35% 3.632 0.65%
Ruslan staged (2 coverage turns + cluster splitter) STARE 3.527 0.09% 3.629 0.52%
Ruslan staged (coverage until ≤3 left) STARE 3.531 0 3.646 0.65%
Minimax worst bucket ARISE 3.573 0 3.676 0.65%
Ruslan balanced f·(n−f) (candidates) SLATE 3.599 0.56% 3.599 0.56%
Max entropy (candidates) RAISE 3.599 0.48% 3.599 0.48%
Explore 1 → candidates SOARE 3.618 0.48% 3.618 0.48%
Ruslan positional (candidates) STARE 3.622 0.65% 3.622 0.65%
Ruslan freq (candidates) ALERT 3.684 0.95% 3.684 0.95%
Random candidate – 4.091 1.30% 4.066 1.68%

The opener column matters: the same rule after SOARE costs 50–80 guesses more than after SALET, so max entropy uses the same SALET opener as the strategies it is compared with (its own pick, SOARE, gives 3.465 / 3.603). The lookahead strategies are normal mode only (their trees are built for normal mode); Strategies › Lookahead in the app explains them and shows the opener and parameter experiments.

Best opener pair: SLATE + HUMID (3.633). Regenerate everything with bun run simulate (--lang ua for Ukrainian).

🇺🇦 Ukrainian (1,717 answers, 7,158 guesses)

The UA optima are our own exact results (scripts/ua-optimal/, a Selby-style exhaustive search in C; proofs modulo 64-bit memo hash collisions):

Tree Opener Total / avg Worst Status
Optimal tree (UA) КОТРА 5805 / 3.3809 6 proven optimal (only КОТРА reaches 5805)
Optimal tree (UA, ≤5 guesses) КОТРА 5806 / 3.3815 5 proven optimal under the 5-guess cap; a 4-guess guarantee is impossible
Optimal tree (UA, hard) КАРСТ 5930 / 3.4537 7 (2 words) proven optimal average in hard mode; 117 other openers can only tie (bound 5930)
Strategy Opener Normal Fail Hard Fail (hard)
Optimal tree (UA) / (UA, hard) КОТРА / КАРСТ 3.3809 0 3.4537 0.12%
Optimal tree (UA, ≤5 guesses) КОТРА 3.3815 0 – –
Lookahead 2-ply (min expected guesses, precomputed tree) КОТРА 3.3809 (5805, worst 6) 0 – –
Small groups + entropy (Σ 1/group + 20·H, instant) КОТРА 3.389 0 3.478 0.52%
Small groups (Σ 1/group, largest ≤ ⌈n/4⌉) КОТРА 3.394 0 3.506 0.41%
Max entropy (any word) КОТРА 3.396 0 3.488 0.29%
Lookahead 2-ply safe (98.0% in ≤ 4, precomputed tree) КОТРА 3.402 0 – –
Min expected size КОТРА 3.409 0 3.503 0.29%
Two-step entropy КОТРА 3.418 0 3.497 0.23%
Explore 2 → candidates (Ruslan balanced) КОТРА 3.433 0.29% 3.514 0.41%
Max entropy (candidates) КОСАР 3.487 0.29% 3.487 0.29%
Ruslan staged (2 coverage turns + cluster splitter) НОРКА 3.490 0.12% 3.575 0.47%
Ruslan staged (coverage until ≤3 left) НОРКА 3.493 0 3.643 1.28%
Explore 1 → candidates КОТРА 3.493 0.35% 3.493 0.35%
Minimax worst bucket КРОНА 3.502 0 3.569 0.58%
Ruslan positional (candidates) НОРКА 3.551 0.52% 3.551 0.52%
Ruslan balanced f·(n−f) (candidates) НОРКА 3.593 0.93% 3.593 0.93%
Ruslan freq (candidates) АКТОР 3.649 0.76% 3.649 0.76%
Random candidate – 4.134 2.27% 4.070 1.75%

Max entropy opens with КОТРА in UA as well (the same opener as Small groups). Gap tables in the app compare each language with its own optimum (EN 3.4212 / 3.5084, UA 3.3809 / 3.4537). How much the second guess matters: docs/analysis-second-step.md (scripts in scripts/analysis/).

🎓 Game review & fingerprint

After every Play game (daily or random, EN and UA) each guess is reviewed: candidates before → after, the bits you actually gained versus the bits that guess was expected to give, the best guess by entropy (hard-mode legal in hard mode) and the optimal-tree move while you are still on the tree, a luck indicator, and short tips (reused grey letters, a yellow letter put back in the same spot, cluster traps, when a non-candidate would have helped). Below it, the optimal strategy plays the same word, and the share card adds your skill (the share of the best expected information your guesses achieved) and luck (bits gained minus bits expected). Every finished game feeds your fingerprint: average skill and its trend, average luck, average guesses, and the strategy whose average is closest to yours. Assistant › Review a game does the same for any game you paste.

Assistant › Review a game

🧮 How it works

Each guess g splits the remaining answers S into up to 3⁵ = 243 colour patterns p. If Sₚ is the group of answers that would show pattern p, then

$$P(p) = \frac{|S_p|}{|S|}, \qquad H(g) = -\sum_{p} P(p),\log_2 P(p)$$

H(g) is the expected information in bits. Seeing pattern p gives log₂(1/P(p)) bits, and identifying one answer among the 2,315 takes log₂ 2315 ≈ 11.18 bits. A guess that splits S evenly gets close to the ceiling of log₂ 243 ≈ 7.92 bits.

  • Entropy picks the guess with the highest H, after a fixed opener (SALET / КОТРА, as Small groups). Two-step adds the expected entropy of the best follow-up guess in each group.
  • Small groups maximises Σₚ 1/|Sₚ| (many groups of one, so a good chance to know the answer next turn), only among guesses whose largest group is at most ⌈|S|/4⌉; if none qualifies it uses max entropy.
  • Small groups + entropy maximises Σₚ 1/|Sₚ| + 20·H(g) over all allowed words, with no cap: the entropy term keeps large groups splitting evenly.
  • Lookahead 2-ply picks the guess with the lowest expected number of guesses, looking one guess further: a group of 1 costs 1, of 2 costs 1.5, and a bigger group costs 1 + the best next guess (over all allowed words) of the mean cost of the groups it leaves, where a group of k ≥ 3 is estimated as (2k − 1)/k + 0.25. Only the top 50 guesses by Σ 1/|Sₚ| plus all candidates are tried. Lookahead 2-ply safe instead maximises the number of answers whose group can be finished within two more guesses. Both are precomputed trees (scripts/lookahead/, see its README), fall back to Small groups + entropy off the tree, and are heuristics: that the 2-ply tree hits the proven optimum (7920 EN, 5805 UA) is an empirical result, not a proof.
  • Minimax minimises maxₚ |Sₚ|. Expected size minimises Σ |Sₚ|² / |S|.
  • Letter frequency: if f is the number of candidates containing a letter and n the number of candidates, the balanced score is f·(n−f). It rewards letters that split the candidates roughly in half.
  • Optimal follows a precomputed decision tree that minimises the total number of guesses over all answers. It is verified on load, and if your guesses leave the tree it falls back to two-step. In Explore › Tree you can start from any allowed word instead: the first guess is yours and every later move is chosen by max entropy (the precomputed tree only covers its own opener).

Feedback is encoded in base 3 (gray 0, yellow 1, green 2), so 242 means all green. Duplicate letters are handled exactly as Wordle does.

🚀 Run it

bun install
bun run dev          # http://localhost:5173
bun run build        # static site in dist/
bun run simulate     # recompute public/sim/*, results.json, optimal tree, opener pairs
bun run test:unit    # engine, coach, routes/redirects, fingerprint, custom-opener trees
bun run test:e2e     # Playwright regression tests against the dev server (needs Chrome; CHROME=/path, BASE_URL=… to override;
                     # definition APIs are served from tests/e2e/fixtures, E2E_LIVE_DICT=1 calls the real ones)
bun scripts/i18n-check.ts           # every UI string has a Ukrainian translation
OUT=shots bun scripts/shots.ts      # screenshots of every view (EN/UA × desktop/390px) + overflow/console check
BASE_URL=http://localhost:4173 bun scripts/readme-shots.ts  # README images in docs/readme/ (against `vite preview`)
bun scripts/notable.ts              # Community › notable words (public/notable.json, public/ua/notable.json) from public/sim/*
bun run definitions  # optional: precompute word meanings into data/ and public/

Docker: docker build -t wordle-lab . && docker run -p 8080:80 wordle-lab (Bun build, served by Caddy with the Caddyfile: precompressed brotli/gzip from the build, immutable caching for /assets/*).

CI: .github/workflows/ci.yml runs the Biome format check, the build, the unit tests and the i18n check on every push to main and every pull request (e2e stays local, it needs Chrome and takes about 9 minutes). Format with bun run format. Releases: release.yml tags and publishes v<version> from the CHANGELOG when a version bump lands on main.

🙏 Credits & data

  • Word lists: original Wordle answers (2,315) and allowed guesses (10,657 extra) from cfreshman's gists (allowed). The gists have no license; they are reproduced with attribution.
  • Optimal trees: alex1770/wordle by Alex Selby, MIT License © 2022 Alex Selby.
  • Ukrainian words: kobzaapp/kobzadict, filtered from VESUM / brown-uk (CC BY-NC-SA 4.0, so the UA data is non-commercial), with answers ranked using hermitdave/FrequencyWords (CC BY-SA 4.0).
  • Definitions: Free Dictionary API and Wiktionary (CC BY-SA 4.0).
  • Inspiration: 3Blue1Brown's Solving Wordle using information theory; An Exact and Interpretable Solution to Wordle by Bertsimas & Paskov.
  • Built with Vue 3, Vite, Tailwind CSS v4, PrimeVue 4 (MIT), Apache ECharts, VueUse, Lucide and canvas-confetti.

Wordle is a trademark of The New York Times Company. This is an unaffiliated fan and research project.

📄 License

MIT © 2026 Ruslan Popelyshyn

About

Wordle game + explainable solver + strategy lab: entropy, minimax, optimal SALET tree, simulations of all 2,315 answers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages