solves the game
- run program
- enter sides 1 by 1
- start
median over 558 nyt puzzles (2025-03 to 2026-10) on an i5-11300H, gcc 16 release build: 0.5ms with the constexpr word list, 0.7ms when loading the word list at runtime (lbs_solver_bench)
- wordlist separator parsing with
std::simd(64 byte blocks, separator mask → indices viacountr_zero), withoutstd::simdblockwise compaction (auto vectorized by clang). Not needed if using constexpr wordlist (enabled per default) - filter word list for allowed characters & character sequences with overlapping bitmasks (no overlap => valid)
- construct graph with words as edges and their character mask connecting allowed character nodes
- traverse graph with iteratively deepening dfs and visited cache pruning longer than optimal paths (after threshold)
- contains settings.hpp with some constants e.g. max solution count
- c++ 23, uses #embed when supported (otherwise the word list is loaded at runtime)
- cmake 4.1+, ninja
- vcpkg with
VCPKG_ROOTset - cth is included as package in
lib/cth
git clone --recursive https://github.com/codethinki/letter_boxed_solver.git
cd letter_boxed_solver
cmake --preset gcc_release
cmake --build out/build/gcc_releaseAlgorithms are theoretically fully constexpr (if you want to solve this problem at compile time for some reason)
**Sources: the wordlists are copied from github/aliceyliang **
Has a chatgpt oneshot solution included as comparison (about 2x slower at the median).