Wordle; the Latest Craze

Wordle has gotten popular. A cross between hangman and MasterMind, it’s cute, simple, and competitive. It has all the elements required to go viral. I finally decided to indulge in the clever word game about a week before it was purchased by the New York Times.

Since the New York Times took charge, there have only been minor changes. Some people are claiming that the New York Times has changed the word list, and is favoring more difficult words. There have also been some mishaps where users have gotten different words from each other.

The way Wordle was written, it has a list of 2,315 words completely exposed in the JavaScript code. Each day the next word in the list becomes the word of the day. One of the first words I encountered when playing was “moist,” the 228th word in the list. The next word, “shard,” appeared on the subsequent day, and so on.

I decided I wanted to see how the New York Times had modified the list. First, I had to find the original list. The original site, powerlanguage.co.uk/wordle/, now redirects to the New York Times, so in order to get the unadulterated code, I used the WayBack Machine to look at the site as it appeared before the sale.

The array of words is contained in a JavaScript file. I extracted the array of words from both the old and new, then compared.

6 words have been removed:

  • agora
  • pupal
  • lynch
  • fibre
  • slave
  • wench

Both “agora” and “pupal” are words that should have appeared in the last few weeks. In fact, “pupal” is the word some people got when visiting the original Wordle site on February 19, 2022, whereas the users who visited the new New York Times version got the word “swill” (which is two words later in the list).

Excerpt from original Wordle list

"moist","shard","pleat","aloft","skill","elder","frame","humor",
"pause","ulcer","ultra","robin","cynic","agora","aroma","caulk",
"shake","pupal","dodge","swill","tacit","other","thorn"

Excerpt from New York Times list

"moist","shard","pleat","aloft","skill","elder","frame","humor",
"pause","ulcer","ultra","robin","cynic","aroma","caulk","shake",
"dodge","swill","tacit","other","thorn"

Since two omitted words have been encountered, the original and new games are now off by two. The next omitted word, “lynch,” won’t be encountered for another 50 or so days (at the time of writing).

Despite the rumors, no words have been added, and the ordering of words has not been otherwise altered.

Since we are on the subject of Wordle, I decided it would be fun to make a utility to help guess the words. It would be too unsporting to just use the word list that the game provides, so I found a list of the most popular English words, and extracted all the five-letter words. This yielded about 3000 words, which is more than the official Wordle list.

I made a simplistic web app that can be used to input the letters and indicate if they appear green or yellow, or not used at all. The app will return a list of possible words for the given configuration.

I don’t condone cheating, and I don’t use this when I play Wordle. It was merely a fun exercise. You can try it out for yourself here.

Clarus the Dogcow

For long-time Apple fans, hardly anything is more iconic than Clarus the Dogcow. Not quite a dog, not quite a cow, Clarus made her debut as part of the Cairo font set drawn by Susan Kare in 1983. Later on in the dogcow’s life, she found herself depicting the orientation of printer paper in the page setup dialog window for Mac OS. I don’t recall exactly in which version she made her debut, but sometime before System 7. And if you are the right age, you may even remember the brown incarnation of the dogcow appearing as a stamp in KidPix!

The dogcow even had official technical notes on Apple’s webpage back in the day! (though those documents were sadly removed in the mid 2000’s)

Naturally, I thought that the best way to commemorate Clarus’ impact on my childhood would be to replicate her likeness in wood. I made a template to follow and cut out strips of light and dark wood that were as uniform as I could make them. These strips of wood served as pixels to my arbor canvas. My dad and I took the little wooden pixels and layed them up against the paper template slowly building up Clarus’ familiar frame. The dark wood is ebony gaboon, and the light wood is maple.

After all the pieces were placed and we corrected any visible mistakes, glue was poured on top. The sides were clamped just enough to keep the pieces from moving. Bursts of air from an air compressor pushed the glue down between the wooden pixels, then finally the clamps were tightened.

Once it was dry, multiple slices were able to be taken from the resulting block of wood which would make the inlays for some miniature cutting board. Four in all were made. Using a CNC router, a rectangular inset was milled away from the maple cutting board, the corners squared up with a chisel, and the inlay glued into place.

All that was left was some sanding and finishing with a food-grade wax to complete these little cutting boards. Kind of a random thing to make, and I honestly can’t remember what made me want to do this in the first place. But I like my little dogcow cutting board and think to myself “moof!” every time that I use it.

Project Euler 43

I like to go back and re-solve Project Euler problems in different languages. Lately, I’ve been solving them in Javascript for fun. When I do this, I don’t look at previous solutions and try to do it from scratch. When I was finished, I was surprised by the performance of my solution to 43 compared to my previous attempts in other languages.

Problem 43 is as follows:

The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.

Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In this way, we note the following:

  • d2d3d4=406 is divisible by 2
  • d3d4d5=063 is divisible by 3
  • d4d5d6=635 is divisible by 5
  • d5d6d7=357 is divisible by 7
  • d6d7d8=572 is divisible by 11
  • d7d8d9=728 is divisible by 13
  • d8d9d10=289 is divisible by 17

Find the sum of all 0 to 9 pandigital numbers with this property.

When I first solved this problem, I solved it in C. This was in 2014, and I was still fairly green. My solution at the time was to iterate through every 10-digit number and see if it was pandigital and then if it was, check if it met the sub-divisibility requirement.

This solution is what you would call “brute-force”. It’s inelegant, and slow. However, it does work. It took 33.948 seconds to compute.

A few years later I was doing more with Rust and Python. Both of these solutions I created used the same method. This probably happened because I wrote both solutions close together. At any case, this time I thought myself more clever and took a pandigital number, 1234567890, and discovered every permutation, and then checked for the sub-divisibility requirement of each.

This is better than brute force, but still time consuming. Python can accomplish this in 18.724 seconds and Rust in 4.621. Better, but still not great.

The general rule of thumb with Project Euler is that if a solution takes more than a second, you haven’t found the intended method of solving it.

Looking at it this time around, it seemed like a very straightforward problem with an obvious path for a solution. Instead of finding pandigital numbers and checking if they meet the sub-string divisibility requirement, this time I would build up the pandigital numbers using the sub-strings.

First I created arrays for the multiples of the first 7 primes with 2 and 3 digits. I then used a recursive function to build up a number using valid combinations of these sub-strings (since each one overlaps the next with 2 digits). This creates a much smaller group of numbers to check.

Once I have all my potential pandigital numbers, I check to make sure they are in fact pandigital. (Note that at this stage, they should be missing the first digit). When checking for pandigitality, I’m actually looking for 9 different digits, and if so, I prepend the missing 10th digit and voila, it’s a valid pandigital number!

This solution is much, much faster at .237 seconds.

I’m very pleased with that result, but a little shocked I didn’t see this method when I have solved it previously. It’s nice to know that since I first started solving these problems years ago, I can see measurable improvement in my ability to find and create solutions to these fun little puzzles.

Source on GitHub

© 2007-2015 Michael Caldwell