Inspiration

In 2020, the New York Times I noticed that the NYT Crosswords app1 had a new game: Spelling Bee. I started causally playing it, and found the mechanics of the underlying words really interesting. FOr example, on days when “U” and “N”, you got a whole bunch of words by sticking in an “UN” prefix (“BOX” -> “UNBOX”). Same thing with “ING”, “TION”, and other constructs.

Naturally, I wanted it to exist in Norwegian too.

Process

Similar to Zipper, this was a side project – and I aimed to keep it that way. Unlike the editors at the NYT, I wasn’t paid to create puzzles every day.

Requirements

  • No backend server
    • (or other costly infrastructure that needed babysitting)
  • Different puzzles every day
  • For a given day, everyone gets the same puzzle

With these requirements in mind, it was pretty clear that this would be another single-page React app, and probably hosted on GitHub Pages.

Data

Thankfully, I had recently completed Ordle, which gave me convenient list of all Norwegian words that I could use!

Build the puzzles

The first thing to do was create the possible puzzles. Thankfully, the process for this was pretty simple:

  1. Filter the dictionary down to words which can be spelled with exactly 7 different letters 2
  2. Go through every pangram, and extract their seven letters
  3. Collapse this down to the unique combinations of seven letters
    1. These represent raw ingredients for the possible puzzles
  4. For every seven-letter grouping, create a unique puzzle, consisting of one center (required) letter and the six other letters
    • For example, if A-B-C-D-E-F-G is one group of seven letters, there are actually seven different puzzles contained within that:
      1. A is required, and B-C-D-E-F-G are optional
      2. B is required, and A-C-D-E-F-G are optional
      3. C is required, and A-B-D-E-F-G are optional

At this point, we have a big list of all possible puzzles. Now what we need to do is the reverse: take a given puzzle and solve it. This process is even more straightforward:

  1. Filter the dictionary for words which:
    • are at least 4 letters long (the limit chosen by NYT and I’m following)
    • have at least one instance of the required letter
    • consist of only the seven letters of the puzzle
Screenshot of the Stavehumle app

A recent version

Build the app

Now I have a huge pile of JSON files (my scripts had emitted every puzzle with the solutions), so I guess it’s time to start building the app. Wiring up the buttons and the styles and the data is easy – it’s what I do, after all.

In order to handle the no-interaction-required project requirement, I took inspiration from the solution I used in Ordle: a semi-random (but predictable) hash was used to choose the letters, and then to select which letter would be the center letter.

Deploy the app

At this point, the app is self-contained and also contains every possible game. I just needed somewhere to host it. I reached for the hammer I knew: GitHub Pages.

And with a git push, I had a playable app that would deploy every time I pushed code changes, but would run for as long as the Internet doesn’t break.

Reflections

Things I learned in the course of this project:

  • Norwegian has a lot of words. So many words.
    • Some puzzles would have as few as 30 words. Some puzzles would have more than 1500 words.

  1. Now called “NYT Games” ↩︎

  2. These are “pangrams”, and every puzzle has at least one pangram ↩︎