Skip to content

codethinki/letter_boxed_solver

Repository files navigation

letter_boxed_solver

introduction

solves the game

usage

  1. start
  2. enter sides 1 by 1
  3. start

on an intel 11th gen it solves it in < 4ms, constexpr word list < 2.5ms

mechanism

  1. simd friendly wordlist separator parsing (auto vectorized by clang). Not needed if using constexpr wordlist (enabled per default)
  2. filter word list for allowed characters & character sequences with overlapping bitmasks (no overlap => valid)
  3. construct graph with words as edges and their character mask connecting allowed character nodes
  4. traverse graph with iteratively deepening dfs and visited cache pruning longer than optimal paths (after threshold)

compiling yourself

what to know

  • contains settings.hpp with some constants e.g. max solution count

requirements

  • c++ 23 with #embed support
  • cth library "install" path specified in the CMakePresets.json (default: ${ProjectDir}../cth/out/install/

Other stuff

Algorithms 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

Simple c++ console based NYT letter boxed game

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors