Optimizing Wordle guesses

Published: Jan 17, 2022 by Steve Baskauf

I’ve recently started playing the viral word game “Wordle”. After numerous discussions among family members about guessing strategy, I decided to spend some time over the holiday weekend writing a Python script to play with different guessing algorithms and strategies.

The details are in a blog post, but if you don’t like reading text and just want to start playing with the code, you can go straight to this Colab notebook to run and hack the code yourself.

The TLDR summary of the blog post is:

  1. I generated a list of five-letter English words of a similar size to what is used in the game.
  2. I created a Wordle_list object that screens word lists based on “guess codes” (an alphanumeric version of the colored squares that the app shows you after you guess).
  3. I messed around with different ways to use letter frequencies in the words to assign scores to words in a list based on estimating how effective the words would be at screening out the other words.
  4. I wrote some code to generate the most effective words to use as automatic first two guesses (spoiler alert). They are “arose” and “glint”.
  5. I used existing Wordle game words to test whether it was more effective to just use these two words, or to let the scoring system chose the second word. It didn’t make much difference.

Enjoy!

Share

Latest Posts

Humboldt Extension for Ecological Inventories Published
Humboldt Extension for Ecological Inventories Published

The Humboldt Extension for Ecological Inventories is a new metadata vocabulary that extends the Darwin Core Standard to make it possible to describe the inventories and sampling events that are used to collect organism occurrence data. This is the largest extension to Darwin Core since the original vocabulary was ratified in 2009 and it represents over three years of work by the Humboldt Extension Task Group. This group of international experts met weekly over that time period to develop the vocabulary, carry out implementation testing, and publish the vocabulary and associated documentation.

Camtrap DP paper published
Camtrap DP paper published

Camera trapping is an increasingly important method used by ecologists for monitoring animals in the wild. Camera trap data has previously been difficult to publish by conventional means, since the data includes many related images or videos that must be associated with the occurrence data. The new Camtrap DP standard provides a way to package camera trap data based on the open Frictionless Data Package specification. Camtrap DP datasets can be easily exchanged or published to the Global Biodiversity Information Facility (GBIF) where the included occurrence data will be integrated with biodiversity data collected by other means.

Nine hundred images added to Wikimedia Commons from ACT
Nine hundred images added to Wikimedia Commons from ACT

Charlotte Lew and I have been working for some time to improve access to images in the Art in the Christian Tradition database by linking descriptive metadata in Wikidata to the corresponding artwork images in Wikimedia Commons. In the first part of the project, we were primarily cleaning up and linking Wikidata metadata to images that were already in Commons.