What Is Wordle and How to Create a Wordle Solver | | Interview Kickstart (2024)

Wordle, a simple word game created by Brooklyn-based software engineer, Josh Wardle, has gone viral! What started as a fun game for Josh and his wife and family has over 3 million players today (The Conversion). In fact, Wordle was recently bought by The New York Times (for an undisclosed low-seven-figure price) and will soon be moved to their website.

In this article, we’re going to look at Wordle from a software engineer’s lens and discuss different algortihms that can be used to solve Wordle. The intention is not to “hack” the game (because that’s no fun!) but to understand what Wordle is and the logic behind solving the most popular game on the internet today.

Here’s what we’ll cover:

  • What Is Wordle and How Does It Work?
  • Tyler Glaiel Algorithm to Create a Wordle Solver
  • Mahmood Hikmet Algorithm to Create a Wordle Solver
  • Andrew Taylor Algorithm to Create a Wordle Solver
  • How to Design Your Own Wordle Solver AI Bot

What Is Wordle and How Does It Work?

So, what is wordle? If you’re here, you’ve probably played the game and know how it works. But let’s quickly go over it, just to be sure.

Wordle (not to be confused with a word cloud) is a word game where you are given six chances to guess a randomly selected 5-letter word. While making each guess, you have to input a valid 5-letter word.

After each guess, the colors of the tiles change to show you how close your guess is to the final word. Here’a an example of a guess in Wordle; let's say you guess the word "THOSE":

What Is Wordle and How to Create a Wordle Solver | | Interview Kickstart (1)

In this Wordle guess example:

  • Green means that the final word contains the letter in the same position.
  • Yellow means that the final word contains these letters but their positions differ from the position of these characters in the guessed word.
  • Grey means that the final word does not contain these letters.

The player keeps getting such hints with each guess and gets 6 guesses to find the right word.

You can use this information to make your next guess, moving closer to the right answer with each guess. But, remember, you only get 6 guesses.

There have been several attempts to create algorithms that could solve the game with more and more accuracy. We’ll look at some of these algorithms to improve guessing accuracy (without resorting to Googling the answers!)

Before we get to the algorithms, let us look at a couple of interesting insights from the source code of Wordle:

  • There are a total of 2,315 possible solutions to the game.
  • There are 12,972 different words that it accepts as guesses. There's a separate set for the guesses so that the player cannot try weird scrabble words like "ABDEE."

Tyler Glaiel Algorithm to Create a Wordle Solver

In order to find the best starter words for solving the game, Glaiel, in his Medium article, came up with an algorithm that gives a hypothetical score to each word in the list of possible guesses. The algorithm behind giving that hypothetical score is:

Every possible guess is checked against every possible solution. Desirable green letters are worth two points, less certain yellow ones are worth one point, and the useless grey ones are worth zero points. At each step, the guess with the highest average score is returned as the guess to be made. In his study, he found that:

  • SOARE: This word had the highest score among all the potential guesses in Wordle. On average, it finds the solution with 3.69017 guesses. However, this was often not fast enough to help players get to the solution; it takes 8 guesses to find the solution in the worst-case scenario.
  • ROATE: This is the word that was able to get to solutions the fastest. On average, it takes 3.49417 guesses to find the solution. Also, it has a worst-case of 5 guesses.

Mahmood Hikmet Algorithm to Create a Wordle Solver

Hikmet designed a Wordle solver tool called Unwordle to help you solve the puzzle with a 99.3% success rate. He came up with an algorithm that works by deducing the frequency at which certain letters appear in the list of possible solutions and ignoring other guesses. That is, the words that use the most popular letters in the list of solutions are considered the best starting words to guess.

After each guess, certain words are eliminated from the list of possible solutions; therefore, the list keeps converging with each guess. It basically examines the list of possible answers in Wordle to figure out the best possible starting guesses. These starting words are listed in order of their effectiveness:

  • SLATE
  • SAUCE
  • SLICE
  • SHALE
  • SAUTE
  • SHARE
  • SOOTY
  • SHINE
  • SUITE
  • CRANE

Andrew Taylor Algorithm to Create a Wordle Solver

Andrew Taylor came up with a combination of the above two strategies. It assigns a numerical score to each potential Wordle solution, with the lowest score signifying the best solutions worth guessing. Here’s what Taylor’s script was able to uncover:

  • REAIS: Taylor named this as the best starting word, with only 168 potential solutions having none of those letters.
  • BLAHS: Taylor named this the best word for eliminating most of the answers.
  • CENTU: This was the second-best word for eliminating most of the answers.
  • DOGGO: This was the third-best word for eliminating most of the answers.

How to Design Your Own Wordle Solver AI Bot

There are several other algorithms that people all over the world have developed to figure out the best starter words and create Wordle solvers. If you are a developer and want to build your own artificially intelligent bot that can solve Wordle puzzles with good accuracy, here’s how you can approach it:

Wordle Solver Algorithm Goal

There are two primary goals that we will have to consider while designing an effective Wordle solver bot:

  1. The algorithm should be fast. It should not take more than a few seconds to solve the puzzle.
  2. The algorithm should be able to solve the puzzle with 100% accuracy.

Wordle Solver Algorithm — The Wider Idea

Let the list of possible answers be: a1, a2, a3 …

And the list of possible guesses be: g1, g2, g3 …

The idea is that we need an algorithm that could keep narrowing down the answers list until only 1 word remains in it.

Initially, all the words in the list are valid. With each guess, some words in the list are eliminated based on the feedback, and the list becomes shorter. Let's say we initially have the following matrix denoting the number of possible answers:

What Is Wordle and How to Create a Wordle Solver | | Interview Kickstart (2)

Every value in this matrix denotes the number of narrowed-down answers with each pair of the guess word and the answer word. Here's how:

  • If the guessed word is w1 and the answer also happens to be w1, then the size of the narrowed-down list of the number of possible answers will become equal to 1. That's why we have value 1 at the (w1, w1) cell. Similarly, we have 1 at (w2, w2), (w3, w3), and (w4, w4).
  • 5 at (w2, w1) denotes that if the guessed word is w1 and the answer is w2, then the size of the narrowed-down list will become equal to 5.

The smaller the size of the narrowed-down list, the higher our chances of getting to the right solution for the Wordle. Therefore, we need to keep decreasing the size of the narrowed-down list with each guess. We can consider two possible strategies for this:

  • Greedy-min-max strategy: This strategy chooses the word which minimizes the worst-case length of the narrowed-down answer list after making a guess. For example, in the above table, if we guess w1, the worst-case length of the narrowed list will be 8 (will happen in case the answer is w4).

    Similarly, the worst-case length of the narrowed list is 7, 5, and 10 if we guess w2, w3, and w4, respectively.
    Observe that guessing w3 at this stage will minimize the length of the narrowed list of answers in the worst-case. Therefore, this strategy will guess the word w3.

  • Average-minimize strategy: This strategy chooses the word that minimizes the average-case length of the narrowed-down list. The average length of the narrowed list if we guess w1, w2, w3, and w4 will be 5, 3.25, 3.5, and 5.75, respectively. Therefore, this strategy will guess the word w2 at this stage.

The algorithm that decides how to fill up the values in the matrix above is for you to interpret. Once you have the matrix, the best way is to test both the greedy-min-max as well as the average-minimize strategy and compare the mathematical results.

This final testing of your solver will be very difficult to do on the official Wordle website as only one puzzle gets published on the website each day. You can test your algorithm for both of the strategies on the Word Master website, which allows you to make as many attempts as possible.

We hope this article has given you some direction to get started with your Wordle solver. If you like creating puzzle solvers, you'll find this post on Sudoku Solver interesting.

All the best and happy coding!

Join Interview Kickstart to Nail Your Next Tech Interview

Interview Kickstart helps software engineers land their dream jobs. We offer industry-best interview prep courses for high-demand domains such as Data Science, Machine Learning, and more.

These courses are designed and taught by FAANG tech leads and hiring managers to help you get into FAANG+ companies.

Sign up for our FREE webinar to learn more.

What Is Wordle and How to Create a Wordle Solver |  | Interview Kickstart (2024)

FAQs

What is the trick for the Wordle solver? ›

To solve Wordle as efficiently as possible, try words that include the letters e, t, a, i, o, n, s, h, and r; these are the most common letters in English. Another great trick is to begin with words that start with the letters t, a, o, d, and w; as again, these are the most common starting letters in English.

How do Wordle solvers work? ›

Mahmood Hikmet Algorithm to Create a Wordle Solver

After each guess, certain words are eliminated from the list of possible solutions; therefore, the list keeps converging with each guess. It basically examines the list of possible answers in Wordle to figure out the best possible starting guesses.

What is the starting word strategy for Wordle? ›

Start with a word that has a lot of vowels.

Some Wordle players have found success in starting with a word that has several vowels in it. “Adieu,” “audio” or “canoe,” for instance, may be good words to start with because at least three out of the five letters are vowels.

What is an example of a Wordle? ›

For example, if you type in “Walks” and the word of the day is “Sable,” the letter A would light up as green. If any of the letters in the word you typed show up as yellow, that means they're in the word of the day — but their placement doesn't correspond to the letter's position in the final word.

What are the 5 words for the Wordle trick? ›

Here are the 5 "Magic" Words that will help you solve Wordle more often than not. "Derby, flank, ghost, winch, jumps."

What is the best 3 word start for Wordle? ›

So RATIO first, then MENDS, then LUCKY. That's it. With those three choices, you'll have slimmed down the list of possible letters to the point that figuring out the solution with your final guesses becomes significantly easier. It's not a surefire winning strategy for every day's puzzle.

Has anyone solved Wordle on first try? ›

3. More people solve Wordle on their first guess than can be explained by chance. In the list above, we excluded first guesses that were that day's Wordle solution. That's because, about one game in every 250, a reader gets the answer right on the first try.

Is there a method to solving Wordle? ›

One of the best ways to beat Wordle is to have a sheet of paper handy while you play. Draw 5 blank lines on the paper (one for each letter), and enter any letters you've already guessed correctly. Write down different words that have those letters to experiment on paper before inputting your guesses into Wordle.

How many times does it take the average person to solve Wordle? ›

On average, most people (almost a third) find the correct answer on their 4th guess, and 78% of people get it within 3 to 5 guesses, making that the sweet spot for solving. We've seen the average number of guesses change over time too – albeit not by much (a gradient of -0.000242).

What is the #1 best first word for Wordle? ›

Alternatively, researchers at MIT have calculated that the best word to start Wordle is SALET.

What is a burner word in Wordle? ›

They are words that you know cannot be right but can prove useful by identifying or ruling out much needed letters before you... Kayode Adesimi. There's a difference between burner words and starter words. Many people have words they always start with, usually to determi...

What is the statistically best word to start Wordle? ›

So there you have it — for the Tom's Guide team at least, the best Wordle start word is STARE. Though, a pair of MIT researchers have their own pick: SALET (a light medieval helmet).

What is the most popular word used in Wordle? ›

Top 50 Wordle Words of 2022
  • glyph.
  • avert.
  • axiom.
  • tepid.
  • adore.
  • joust.
  • naive.
  • aorta.

What is the most commonly used letter in Wordle? ›

We see from Figure 1 that “e” is the letter that is most frequently used (1,233 times in total), followed by “a”, “r”, “o”, “t”, “l”, “i”, “s”, “n”, “c”. The most frequently used letter in the first position is “s”, while the most frequently used letter in the second or third position is “a”.

What is the easiest way to solve Wordle? ›

Every 5-letter word has at least one vowel, so vowels are a great starting point. Including at least three vowels in your first word can help you get the most yellow and green letters up front and make your next guesses easier.

How to solve Wordle in 3 tries? ›

Strategy for victory within three tries

Based on Figure 2, “slate” is the best initial guess. This means that it has the best chance of producing a win within 3 tries. The best second guess then depends on the pattern that Wordle returns after the first guess.

What are the best 5 letter words for Wordle? ›

Common Five-letter Words for Wordle, List 4
  • drool.
  • carry.
  • unite.
  • final.
  • worth.
  • scene.
  • proud.
  • false.

Top Articles
3 ways to differentiate between fake and authentic iPad that not everyone knows
Dollar-Cost Averaging: Pros and Cons
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
How To Cut Eelgrass Grounded
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Umn Biology
Obituaries, 2001 | El Paso County, TXGenWeb
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Colin Donnell Lpsg
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
San Pedro Sula To Miami Google Flights
Selly Medaline
Latest Posts
Article information

Author: Reed Wilderman

Last Updated:

Views: 6458

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Reed Wilderman

Birthday: 1992-06-14

Address: 998 Estell Village, Lake Oscarberg, SD 48713-6877

Phone: +21813267449721

Job: Technology Engineer

Hobby: Swimming, Do it yourself, Beekeeping, Lapidary, Cosplaying, Hiking, Graffiti

Introduction: My name is Reed Wilderman, I am a faithful, bright, lucky, adventurous, lively, rich, vast person who loves writing and wants to share my knowledge and understanding with you.