Skip to main content

Wordle solver!

Project description

Wordler!

Wordler! is an app for solving Wordle puzzles. In its current form, Wordler! is a command line interface (CLI) app, but work on a web app is underway, too.

Using Wordler! is pretty straightforward. First, you provide your initial guess to the app, and then it will ask if this initial guess solved the possible. If the puzzle has not been solved, the app will then ask for Wordle's feedback on the guess. Wordler! will display the letter in the guess, and you'll select which letters Wordle has highlighted green and which letters Wordle has highlighted yellow.

Wordler! will then take this information and provide you with a new guess - along with a probability that this guess is the answer to the puzzle - to enter into Wordle. It will then go through the same steps of asking if the puzzle has been solved, and if not asking for the green and yellow tiles. Wordler! solves the puzzle almost all of the time, and on average, takes about 3.65 guess (including your initial guess) to find the correct word.

Check out the example of Wordler! solving the puzzle for the word "meter" below:

Installation

The Wordler! CLI app has been published to PyPI and can be installed with PIP.

pip install wordler-cli

You can also build the CLI app directly from source by running the following in an environment of your choosing:

pip install git+https://github.com/k-bartolomeo/wordler.git

Methodology

Wordler! starts off with sets of all possible letters for each position in a word. As it receives feedback from the Wordle game itself, it will update these sets of letters. For example, if the correct word is meter and the guess word is tried, Wordle will mark the e in tried green and the t and the r yellow. After receiving this information from the user, Wordler! will then update the set of possible letters for each position as follows:

  • Remove t from the set of possible letters for the first position.
  • Remove r from the set of possible letters for the second position.
  • Reduce the set for the fourth position to just the letter e, since that is the correct letter.
  • Remove the letters i and d from all position sets since they are not in the goal word.
  • Update the set of letters that must be included in the next guess to include t, r, and e if they are not present in the set already.

From there, Wordler! will update the list of remaining possible words based on the letters available for each position. Then, it will compute a probability for each remaining word using a combination of letter probabilities given word positions, transition probabilities from one letter to the next, and usage probabilities. The need for the first two probabilities is pretty self-evident; the inclusion of the usage probabilities, on the other hand, is based on the assumption that the NY Times editor choosing the Wordle words will be more likely to choose words that are used more often, as opposed to words with which the general public may be less familiar.

As far as the calculation of these various probabilities goes, the letter probabilities given the word positions are computed using counts of each letter in each position in the words in the Wordle corpus. Similar counts from the words in the Wordle corpus are used for the transition probabilities. These transition counts also consider word position in order to account for the fact that the probability of a transition, for example, from letter 1 to letter 2 might be higher if letter 1 is the first letter in the word instead of the third letter in the word. Usage probabilities are taken from this subset of usage counts derived from the Google Web Trillion Word Corpus.

Web App

A web application that offers the same functionality as the CLI, albeit in a more aesthetically pleasing manner, is currently under development. This application is being built using mostly Python and the Dash framework, with a small bit of JavaScript sprinkled in. The basic layout of the application is pictured below, and the code that has been written for the app thus far can be found on the app-dev branch of this repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordler_cli-0.0.1.tar.gz (33.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordler_cli-0.0.1-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file wordler_cli-0.0.1.tar.gz.

File metadata

  • Download URL: wordler_cli-0.0.1.tar.gz
  • Upload date:
  • Size: 33.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.4

File hashes

Hashes for wordler_cli-0.0.1.tar.gz
Algorithm Hash digest
SHA256 076bef5c9055657565d459a64b05d54f8a778c1b6811e0adb4c205db76be52c8
MD5 c61ab73e8e856c8293d4f4e273549403
BLAKE2b-256 e065393cce3cbec2b799b5d9a7aa7954359fae5d67a11f909fb5cfbec5ca93c1

See more details on using hashes here.

File details

Details for the file wordler_cli-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: wordler_cli-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.4

File hashes

Hashes for wordler_cli-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f4ac1a7945c724890deedc61df42297300ae3dd51163e5cfe7cef0dcdfa633
MD5 5e9e2812cfc5ddf82635ac6563c22fe9
BLAKE2b-256 914c83751945f3c50b4eb3e5bbc4242733b17f24d816a83d27839180af0fab2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page