Open-source implementation of Letter Boxed including puzzle generation and solver.
Now that the original game has been placed behind a paywall, I created this fork of Litter Boxed and have started adding new features, including..
- Dark mode support (and theming override)
- Improved puzzle solving validation
- Random game generator for infinite play
- View solutions for any generated puzzle
- Smooth animations
- A "par" system similar to what you have in the original game
- Streak tracking
- Puzzle generation is ensured in the browser.
- Two different lists are used: an easy list so that puzzles have a simple solution and a complete list for input validation.
- Daily puzzles are generated by seeding the random generator with the date.
- Unlike the NYT puzzles, we guarantee that there is always a solution with two words that repeats only the common letter (e.g. LANDS > SECURITY).
-
Puzzle generation is done by sampling two words (in
O(1)) then checking whether the letters can be arranged on a square.- It would be OK to enumerate the
12!/(3!^4*4!) = 15 400possibilities, but to be more efficient, we adapted Ali Aassaf's Algorithm X in JavaScript.
- It would be OK to enumerate the
-
Puzzle solving is pretty boring:
- Select words that can be written in the grid
- For each letter, bruteforce the pairs of words that begin/end with this letter
