DEV Community

Cover image for Lexicon Titan: Solving the O(n!) Problem with Web Workers and Bitmasking
bingkahu (Matteo)
bingkahu (Matteo)

Posted on

Lexicon Titan: Solving the O(n!) Problem with Web Workers and Bitmasking

Engineering a High-Performance Word Intelligence Suite

Most "word unscramblers" on the web today are... let's be honest, pretty clunky. They either rely on heavy server-side processing that lags, or they try to run heavy permutations on the main UI thread, resulting in that dreaded "Page Unresponsive" popup.

When I started building Lexicon Titan, I had one goal: Zero-latency word processing on the edge.

๐Ÿ›  The Technical Challenge: Beating the Permutation Trap

The naive approach to unscrambling letters is generating all possible permutations. For a 7-letter word, that's 5,040 combinations. Easy. But for 15 letters? That's 1.3 trillion combinations.

To solve this for Lexicon Titan, I moved away from permutations and implemented a Frequency Distribution Bitmask. Instead of "shuffling" letters, the engine creates a character map of your input and does a single-pass filter over a 370k-word dictionary.

The Multithreaded Edge

Even with an optimized algorithm, running this logic on the main thread is a crime against UX. I implemented a Web Worker architecture to offload the heavy lifting. This allows the UI to stay "buttery" (60fps) while the background thread handles the raw computation.

โœจ Feature Suite (Beta V1.0)

I didn't just want a solver; I wanted a "Titan" of a suite. Currently, the build includes:

  • The Titan Unscrambler: Handles 20+ characters + double wildcards using specialized bit-matching.
  • Honeycomb Solver: Specifically architected for "Spelling Bee" style puzzles with mandatory center-letter logic.
  • Predictive Wordle Engine: A multi-layered filter that narrows down 5-letter possibilities based on positional green/yellow feedback.
  • Linguistic API Integration: Real-time rhyme and synonym fetching via the Datamuse API.

Status: Proprietary Beta & Work in Progress

Iโ€™m still in the laboratory with this one. Itโ€™s currently in Closed Beta as I refine the mobile responsiveness and the Glassmorphism UI.

Because Iโ€™m testing some unique algorithmic optimizations, the project is currently Proprietary (All Rights Reserved). However, Iโ€™m looking for fellow devs to help me break it!

๐Ÿค Get Special Beta Access

Iโ€™m opening up a few slots for Special Beta Feature Access. This includes:

  1. Advanced Anagram Builder: For multi-word phrase unscrambling.
  2. Custom Dictionary Uploads: Use your own specialized word lists.
  3. API Access: Early look at the internal endpoints.

Interested? * Check out the live Beta: word-unscrambler.pages.dev


Powered by โ˜• and a lot of console.logs.

Top comments (0)