WordleStartOptimizer: When Wordle Becomes a Combinatorics Problem

A C# command-line tool that searches for multi-word opening sets, precomputes Wordle feedback into a pattern matrix, and prunes a huge search space with bitmasks and scoring.

8 min read View on GitHub More from Liamth99

A strategist’s desk built from Wordle tiles, with several five-letter word cards arranged like a planning board. Some letters are visibly blocked out across the set, showing that the goal is not one perfect guess but a coordinated opening strategy that covers more of the alphabet.
The project treats Wordle openings like a coverage problem, not a single-word ranking problem.
Key Takeaways

The wrong way to think about Wordle

Most Wordle tools try to tell you the best next guess. This repo asks a different question: what if the real unit of optimization is a set of starting words, not a single word? That changes the whole shape of the problem. Instead of ranking five-letter guesses one by one, the program searches for 2 to 5-word opening sets that cover more letters with fewer collisions.

That shift matters because Wordle is not only about lucking into the answer. It is about buying information fast. WordleStartOptimizer turns that into a search problem, then attacks it with the kind of machinery you would expect in a small systems tool, not a casual puzzle helper.

The solver works by eliminating bad combinations early, then spending full scoring only on the survivors.

From letters to a pattern matrix

The first performance move is to stop thinking about Wordle feedback as text. In the repo, guess-versus-answer results are precomputed into a PatternMatrix, where each result is encoded numerically instead of recalculated over and over. Grey, yellow, and green become machine-friendly states that can be compared quickly during scoring.

// Conceptual shape of the feedback model
// 0 = grey, 1 = yellow, 2 = green
int pattern = PatternMatrix[guessIndex, answerIndex];

// The key idea: compute once at startup,
// reuse everywhere during search.

That matters because the expensive part of the tool is not Wordle feedback itself. It is doing that feedback calculation across thousands of candidate combinations and a large answer space. By front-loading the work, the search loop becomes mostly arithmetic and lookups.

The bitmask move that makes the search possible

A close-up mechanical lock with 26 small pins arranged in a ring. Several pins jam because they represent repeated letters, while one clean combination releases the mechanism and turns the lock smoothly, showing how duplicate-letter collisions are filtered out quickly.
Bitmasks turn letter collisions into an instant yes-or-no check.

The real acceleration comes from the 26-bit mask. Each word is reduced to a compact representation of which letters it contains, so duplicate detection across a candidate set becomes a bitwise AND instead of a character-by-character comparison. If two words share a letter, the collision shows up immediately.

if ((mask & (1 << bit)) is not 0) return -1; // duplicate letter detected

// Later, combining words is just another bitwise collision check.

That tiny trick is what makes multi-word search feasible. Without it, the combinatorial explosion would drown the solver before scoring even began.

Why the solver scores more than entropy

This repo does not worship entropy alone. It mixes several metrics, then normalizes them so the command-line user can weight what matters. The result is a scoring model that is mathematical, but not emotionless. It reflects the way humans actually want to play: enough information to be efficient, enough common letters to feel sensible.

MetricWhat it rewardsWhy it exists
EntropyBroad information gainMeasures how much a word or set splits the answer space
Expected remainingSmaller average solution poolsCaptures practical usefulness, not just theoretical spread
Worst case remainingBetter protection against bad branchesKeeps the search from optimizing for lucky averages
Vowel and letter heuristicsWords that feel playableAdds human preference to the mathematical score

That mix is the project’s personality. It is not pretending that the best strategy is purely abstract. It is trying to find opening sets that are strong on paper and still look like something a person would actually type.

Pruning the combinatorial explosion

The search strategy is staged. First, the solver generates only viable candidate sets that satisfy the no-overlap rule. Then it applies a cheaper pre-score to throw out weak combinations before doing the more expensive full evaluation against the answer list. That is the difference between brute force and a search engine.

It is also why the project feels more like a research tool than a toy. The solver is not just exploring possibilities. It is actively collapsing a huge space into something a single machine can handle in a reasonable amount of time.

How this differs from ordinary Wordle solvers

Ordinary solverWordleStartOptimizer
Ranks one guess at a timeSearches for 2 to 5-word opening sets
Optimizes a single moveOptimizes coverage across multiple moves
Mostly compares words directlyUses a precomputed pattern matrix and numeric feedback
Relies on broad guess scoringBlends entropy, remaining space, and heuristics
Prunes shallowlyPrunes in stages before expensive scoring

That contrast is the whole article in one sentence: most Wordle tools ask, 'What word should I play next?' This repo asks, 'What opening system gives me the best chance of solving the puzzle fast?' Those are related questions, but they produce very different software.

What the author is really optimizing

The deeper story is not about Wordle alone. It is about turning a small daily game into a compact demonstration of modern C# engineering: parallel startup work, bitmasking, staged pruning, and a scoring model that blends math with taste. The repo takes a familiar puzzle and reveals how much structure is hiding inside it.

That is the charm. It is a cheat sheet, yes. It is also a tiny laboratory for search design. WordleStartOptimizer treats a five-letter game as a system to be modeled, measured, and narrowed until only the best openings remain.