Wordle is an interesting game. Let's solve it!

Overview

wordle

Wordle is an interesting game. Let's solve it!

Algorithm

The algorithm is simple:

  1. On the first attempt, guess the highest ranked word in the dictionary
  2. Use the result to assemble a regex that will only match potential solutions
  3. On subsequent attempts, guess the highest ranked word in the dictionary that matches the regex and contains all potential characters
  4. Repeat until finding the solution or running out of guesses

This algorithm is implemented in Wordle.kt

Known Issues

This algorithm is pretty naive. It does not keep track of the letter positions that have already been tested, which means that it wastes guesses re-discovering information that it already knows.

Here's an example to drive the point home:

Guess 1 is which
Correct letters: [null, null, null, null, null]
Known present letters: [i]
Known absent letters: [c, w, h]

Guess 2 is first
Correct letters: [null, null, null, null, null]
Known present letters: [f, i]
Known absent letters: [r, c, s, t, w, h]

Guess 3 is field
Correct letters: [null, null, null, null, null]
Known present letters: [e, f, i]
Known absent letters: [r, c, s, t, d, w, h, l]

Guess 4 is knife
Correct letters: [null, null, null, null, e]
Known present letters: [e, f, i]
Known absent letters: [r, c, s, t, d, w, h, k, l, n]

Guess 5 is effie
The solution is effie

In this case, the solution to the puzzle was found, but guessing "field" right after "first" was wasteful, because we already know that "f" is not in the first position. The next guess, "knife", is much smarter, because it tries a new position for "f", which helps to expand what we know about the solution.

Data

This implementation relies on a dictionary of 5 letter long English language words that has been ranked in order of frequency of use. I grabbed my dataset from kaggle.com and filtered it to contain only five letter words using the code in FilterWordList.kt.

Next Steps

Right now, this code can only solve a wordle that you already know the answer to. In that sense, it's really just a proof of concept for the algorithm. In the future, I'd like to expand on this code to include a visualization of the game, or maybe even to play against the actual website.

You might also like...
a custom pull-to-refresh layout which contains a interesting animation
a custom pull-to-refresh layout which contains a interesting animation

This is a project with custom pull-to-refresh layout which contains a interesting animation. And the animation is inspired by https://dribbble.com/sho

Android fillable progress view working with SVG paths. This is a nice option too if you want to create an interesting branding logo for your app. Based on the iOS project: https://github.com/poolqf/FillableLoaders
Android fillable progress view working with SVG paths. This is a nice option too if you want to create an interesting branding logo for your app. Based on the iOS project: https://github.com/poolqf/FillableLoaders

Android FillableLoaders Android Open Source library providing an interesting fillable progress view working with SVG paths. This is a nice option too

An interesting workout app, that can track your progress (unfinished)
An interesting workout app, that can track your progress (unfinished)

7MinuteWorkout An interesting workout app, that can track your progress (unfinished) U planu mi je da odradim bolji dizajn za ovu aplikaciju. Za sada

Make interesting books for your kids, usint text and images from simple.wikipedia.org

Baby Book Builder Baby Book Builder is an Android app and a website for creating books to help your growing child learn. Contributing Donations Baby B

Application to solve a personal problem, which was the wish to have a simple app that handles a market list with prices, quantity and total price
Application to solve a personal problem, which was the wish to have a simple app that handles a market list with prices, quantity and total price

Market List Application that handles a market list offline in device's storage system. The list can be just pasted in a big edit text field and the ap

This is a sample app to use [Molecule library] and solve some scoping problems in Android development.
This is a sample app to use [Molecule library] and solve some scoping problems in Android development.

Android sample app Problem It's started when P.Y. in Twitter shared this tweet and his post, which is a correct complain about introducing a new set o

Medich is an application that raises the problem of satisfaction related to BPJS, especially in the lower classes, with Medich being able to solve all these problems
Medich is an application that raises the problem of satisfaction related to BPJS, especially in the lower classes, with Medich being able to solve all these problems

Medich is an application that raises the problem of satisfaction related to BPJS, especially in the lower classes, with Medich being able to solve all these problems. Medich has a Donation feature that will be very useful for the Community

This is the kotlin-based android application. In this you can solve upto 100 flag-quiz question and enhance your skill.
This is the kotlin-based android application. In this you can solve upto 100 flag-quiz question and enhance your skill.

Flag Quiz App - DOWNLOAD APP Enhance your knowledge by taking part in this Quiz - 100 Questions in 30 minutes It is based on the Kotlin language. You

TwitchControlsMinecraft - A mod that lets your twitch chat let things happen in your game on a specific event

Twitch Controls Minecraft A mod that lets your Twitch chat lets your twitch chat

This is an application that is about an X / O game. You can enter the names of the game, and there is also a screen for those who win and there is a button to continue playing and the game determines the result of each player
This is an application that is about an X / O game. You can enter the names of the game, and there is also a screen for those who win and there is a button to continue playing and the game determines the result of each player

Game-X-O This is an application that is about an X / O game. You can enter the names of the game, and there is also a screen for those who win and the

WordMasterKMP - WIP Kotlin Multiplatform sample inspired by Wordle and also Word Master web sample
WordMasterKMP - WIP Kotlin Multiplatform sample inspired by Wordle and also Word Master web sample

WordMasterKMP WIP Kotlin Multiplatform sample inspired by Wordle and also Word M

Faradle - Wordle made in Jetpack Compose
Faradle - Wordle made in Jetpack Compose

Faradle The famous Wordle game created with Jetpack Compose The logic is fully u

WordleSolver - Wordle solving application made with Compose
WordleSolver - Wordle solving application made with Compose

WordleSolver Wordle solving application made with Compose for Desktop. Screensho

WordleFX - Wordle in JavaFX and Kotlin
WordleFX - Wordle in JavaFX and Kotlin

Wordle This simple game is everywhere right now (the beginning of 2022) and it s

Media Picker is an Android Libary that lets you to select multiple images or video
Media Picker is an Android Libary that lets you to select multiple images or video

Media Picker Please let me know if your application go to production via this link Media Picker is an Android Libary that lets you to select multiple

An Android app that lets you download free children's books in different languages from non-profit publisher Book Dash
An Android app that lets you download free children's books in different languages from non-profit publisher Book Dash

Bookdash Android Check out the blog post here: http://riggaroo.co.za/book-dash-android-app/ Download the app: https://play.google.com/store/apps/detai

Endoscope lets you to stream live video between android devices over Wi-Fi! 📱📲
Endoscope lets you to stream live video between android devices over Wi-Fi! 📱📲

Endoscope - RTSP live video streamer for android devices via Wi-Fi. Project is no longer supported. Alternative solution is under development. Stay tu

Media Picker is an Android Libary that lets you to select multiple images or video
Media Picker is an Android Libary that lets you to select multiple images or video

Media Picker Please let me know if your application go to production via this link Media Picker is an Android Libary that lets you to select multiple

Android library project that lets you manage the location updates to be as painless as possible

Smart Location Library Android library project that intends to simplify the usage of location providers and activity recognition with a nice fluid API

Owner
Jonathan
Jonathan
Analyze any Android/Java based app or game

ClassyShark Introduction ClassyShark is a standalone binary inspection tool for Android developers. It can reliably browse any Android executable and

Google 7.2k Jan 3, 2023
A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffolding when apk is a unity il2cpp game. Write code on a apk file elegantly.

FakerAndroid (FakerAndroid.jar or FakerAndroid-AS) A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffold

null 231 Dec 29, 2022
WordleSolver - A small attempt to solve the Wordle game (in Spanish) without thinking too much

Wordle solver A small attempt to solve the Wordle game (in Spanish) without thin

Eduardo Pascua 2 Sep 30, 2022
Wordle-solver - This application supports in finding the correct answer to the daily word puzzle game Wordle

Wordle-solver - This application supports in finding the correct answer to the daily word puzzle game Wordle

Jiri Bakker 1 Jan 19, 2022
Wordle-solver - Evaluates the efficacy of Wordle algorithms

Wordle Solver Wordle solver harness that evaluates the efficacy of any given alg

Daniel Lew 12 Feb 8, 2022
Wordlesolver - Wordle (Gurgle) solver with code from Wordle-Solver

WordleSolver Wordle (Gurgle) solver with code from https://github.com/PoorLazyCo

Bill Farmer 9 Nov 27, 2022
Wordle-clone-android - A Wordle Clone For Android

wordle-clone-android A Wordle Clone For Android Setup Add answer-bank.txt to the

Donovan LaDuke 5 Jul 17, 2022
WordGuess - A portuguese game inspired in the world fever wordle game

WordGuess WordGuess is a portuguese game inspired in the world fever wordle game

Anthoni Ipiranga 6 Jul 28, 2022
Wordle game clone written in Kotlin & using Compose UI Toolkit.

Wordle Compose Wordle game clone written in Kotlin & using Compose UI Toolkit. Screenshots Compose for Desktop Main screens Playing Victory End of gam

Olivier Patry 37 Nov 3, 2022
The Destiny lore word game, that's definitely not just a worse version of Wordle!

Wormdle The Destiny lore word game, that's definitely not just a worse version of Wordle! Why not use an existing clone? Ever wanted to play Wordle, b

Ian Moore 2 Feb 6, 2022