The most comprehensive, exhaustive, parameterized command-line wordle solver.

Overview

Wordle Solver

The most comprehensive, exhaustive, parameterized command-line wordle (https://www.powerlanguage.co.uk/wordle/) solver. Wordle is a really popular game made viral by it's inscrutable and quirky emoticon-based game description.

The solver boasts a 99.35%+ accuracy on the 8636 valid 5-letter words. Features:

  • Supports 4 modes: play, show (to show a solution for a specific word), solve (to solve a puzzle online) and eval (evaluate the performance)
  • Deterministic
  • Highest accuracy of all solutions evaluated
  • Fully tested
  • Latency ~0.26s per run Current dictionary used is the valid Scrabble dictionary.

Solver’s attempt to solve the Jan 10, 2022 wordle for the word query:

β¬›πŸŸ¨β¬›β¬›πŸŸ¨ AROSE
β¬›πŸŸ©β¬›β¬›β¬› TUMID
β¬›β¬›πŸŸ¨β¬›β¬› GLYPH
🟩🟩🟩🟩🟩 QUERY

Screen Shot 2022-01-12 at 12 26 16 AM

Algorithm

With the settings for non-strict play, using positional

  • Find all candidates that fit the criteria
  • Amongst the valid candidates, compute a distribution of letters at each position
  • Find a word from all valid guesses which optimizes sum(P(letter at pos i)) + 0.5 * sum(P letter not at pos i)
  • Repeat

The 56 failure cases are sakes, mooed, jived, wanes, jocks, minks, wades, jaded, zoner, joker, wived, jakes, mozos, goxes, vills, rover, zooks, cozes, jibes, wakes, hajes, joked, sinhs, zaxes, yaffs, hiker, bases, moved, bises, zills, hided, eaved, vined, surfs, jiber, gibed, dozer, fuzed, mixed, boxed, waxes, waves, vomer, egged, mazed, pests, hived, socks, fazes, vests, jibed, mewed, hazes, sooks, woods, sinks For all these words, there are 2-5 candidate words left at the last guess, and with a random last guess, there is a probability of guessing these too.

Usage

Play it yourself

python main.py -m play

Guess? tares
TARES
β¬›πŸŸ©πŸŸ¨β¬›β¬›
Guess? unlit
UNLIT
⬛⬛⬛⬛⬛
Guess? raver
RAVER
πŸŸ¨πŸŸ©πŸŸ©β¬›πŸŸ©
Guess? favor
FAVOR
🟩🟩🟩🟩🟩
Solved! - favor

Solve for an unknown word

python main.py -m solve

Try the word [TARES]. There are 8636 possible words: ['aahed', 'aalii', 'aargh', 'abaca', 'abaci']...
How did it do (0=⬛, 1=🟨, 2=🟩) e.g. 00000? 00000
Try the word [NOILY]. There are 575 possible words: ['biddy', 'biffy', 'bifid', 'bigly', 'bijou']...
How did it do (0=⬛, 1=🟨, 2=🟩) e.g. 00000? 02002
Try the word [DHOBI]. There are 39 possible words: ['bobby', 'boggy', 'booby', 'boogy', 'boomy']...
How did it do (0=⬛, 1=🟨, 2=🟩) e.g. 00000? 20100
Try the word [DODGY]. There are 3 possible words: ['dodgy', 'doggy', 'dowdy']...
How did it do (0=⬛, 1=🟨, 2=🟩) e.g. 00000? 22122
Try the word [DOGGY]. There are 1 possible words: ['doggy']...
How did it do (0=⬛, 1=🟨, 2=🟩) e.g. 00000? 22222
Solved! = doggy

Show a solution for a specific word

python main.py -m show -w oozed

Word [OOZED]
Choosing [tares]. Total 8636 candidates: ['aahed', 'aalii', 'aargh', 'abaca', 'abaci']...
TARES
β¬›β¬›β¬›πŸŸ©β¬›
Choosing [coled]. Total 288 candidates: ['bedel', 'bedew', 'bevel', 'bezel', 'bided']...
COLED
β¬›πŸŸ©β¬›πŸŸ©πŸŸ©
Choosing [howdy]. Total 31 candidates: ['boded', 'boned', 'booed', 'bowed', 'boxed']...
HOWDY
β¬›πŸŸ©β¬›πŸŸ¨β¬›
Choosing [bipod]. Total 16 candidates: ['boded', 'boned', 'booed', 'boxed', 'domed']...
BIPOD
β¬›β¬›β¬›πŸŸ¨πŸŸ©
Choosing [dozen]. Total 8 candidates: ['domed', 'dozed', 'foxed', 'joked', 'mooed']...
DOZEN
πŸŸ¨πŸŸ©πŸŸ©πŸŸ©β¬›
Choosing [oozed]. Total 1 candidates: ['oozed']...
OOZED
🟩🟩🟩🟩🟩
Solved! - oozed
Woohoo! Solver solved it in 6 guesses!

Evaluate its performance

python main.py -m eval -k 1000

Evaluating on 1000 words
k=10:	Failed: 1	Accuracy:90.00%	Avg Time: 0.258s
k=20:	Failed: 1	Accuracy:95.00%	Avg Time: 0.250s
k=30:	Failed: 1	Accuracy:96.67%	Avg Time: 0.249s
k=40:	Failed: 1	Accuracy:97.50%	Avg Time: 0.244s
k=50:	Failed: 1	Accuracy:98.00%	Avg Time: 0.239s
...
k=970:	Failed: 10	Accuracy:98.97%	Avg Time: 0.236s
k=980:	Failed: 10	Accuracy:98.98%	Avg Time: 0.236s
k=990:	Failed: 10	Accuracy:98.99%	Avg Time: 0.236s
Failed on: ['jived', 'hides', 'razer', 'zooks', 'jills', 'gibed', 'wises', 'yipes', 'wipes', 'sises']
Distribution of remaining candidates: [(4, 5), (3, 3), (2, 1), (5, 1)]
K=999:	Failed: 10	Accuracy:99.00%

Run Tests

python -m unittest runs the entire test suite.

Evaluation

Using a dictionary of scrabble words, there are 172,819 total words and around 5% of them are exactly 5 letters long (8,636). The algorithm devised achieves a 99.28% success rate at guessing the right word, failing to get the correct the answer for 62 words.

Other settings achieved:

  • Global character frequency heuristic: Couldn't solve for 133 out of 1000 random samples (86.7% Success rate)
  • Conditional character frequency heuristic, on candidates left: Couldn't solve for 100 out of 1000 random samples (90.0% Success rate)
  • Non-strict solution: Couldn't solve for 46 out of 1000 random samples (95.4% Success rate)
  • Position-aware frequency heuristic + bug fixes: Couldn't solve for 9 out of 1000 random samples (99.1% Success rate)

Future Work

  • Support passing in solver settings through command line, including the weight of NON_POS_WEIGHT
  • Support passing in a custom dictionary through settings
  • Expose customizable number of letters in the word (N) and MAX_GUESSES.
Owner
Debarghya Das
Debarghya Das
Code for the Open Data Day 2022 publicbodies.org Nepal data scraping activities.

Open Data Day Publicbodies.org Nepal We've gathered on Saturday, 5th March 2022 with Open Knowledge Nepal in order to try and automate the collection

Augusto Herrmann 2 Mar 12, 2022
A cli tool , which shows you all the next possible words you can guess from in the game of Wordle.

wordle-helper A cli tool , which shows you all the next possible words you can guess from the Game Wordle. This repo has the code discussed in the You

1 Jan 17, 2022
A simple python script to execute a command when a YubiKey is disconnected

YubiKeyExecute A python script to execute a command when a YubiKey / YubiKeys are disconnected. β€β€β€Ž β€Ž How to use: 1. Download the latest release and d

6 Mar 12, 2022
Yts-cli-streamer - A CLI movie streaming client which works on yts.mx API written in python

YTSP It is a CLI movie streaming client which works on yts.mx API written in pyt

1 Feb 05, 2022
🌈 Beautify your command line interfaces.

Basics Install: pip install iridi Usage: import iridi # Create gradient text # iridi.print(message, colors, options) # Ask for input with gradient

Conrad Crawford 39 Oct 20, 2022
Detect secret in source code, scan your repo for leaks. Find secrets with GitGuardian and prevent leaked credentials. GitGuardian is an automated secrets detection & remediation service.

GitGuardian Shield: protect your secrets with GitGuardian GitGuardian shield (ggshield) is a CLI application that runs in your local environment or in

GitGuardian 1.2k Jan 06, 2023
A Simple Python CLI Lockpicking Tool

Cryptex a simple CLI lockpicking tool What can it do: Encode / Decode Hex Encode / Decode Base64 Break Randomly :D Requirements: Python3 Linux as your

Alex Kollar 23 Jul 04, 2022
Cek Username IG Yang Masih Bisa Dipake

Cek Username IG Cara Install $ pkg update && pkg upgrade $ pkg install python $ pkg install git $ git clone https://github.com/Dekusec/ig-checker $ cd

Deku 3 Nov 28, 2021
Magma is a NeoVim plugin for running code interactively with Jupyter.

Magma Magma is a NeoVim plugin for running code interactively with Jupyter. Requirements NeoVim 0.5+ Python 3.8+ Required Python packages: pynvim (for

Daniel Csillag 372 Dec 26, 2022
Enlighten Progress Bar is a console progress bar library for Python.

Overview Enlighten Progress Bar is a console progress bar library for Python. The main advantage of Enlighten is it allows writing to stdout and stder

Rockhopper Technologies 265 Dec 28, 2022
A communist shell written in Python

kash A communist shell written in Python It doesn't support escapes, quotes, comment lines, |, &&, , or similar yet. If you need help, get it from

Γ‡Δ±nar YΔ±lmaz 1 Dec 10, 2021
Seamlessly run Python code in IPython from Vim

Seamlessly run Python code from Vim in IPython, including executing individual code cells similar to Jupyter notebooks and MATLAB. This plugin also supports other languages and REPLs such as Julia.

Hans Chen 269 Dec 20, 2022
A Hikari command handler for people who love ducks.

A Hikari command handler for people who love ducks.

Jeremiah 2 Oct 09, 2022
Another (unofficial) Qt CLI Installer on multi-platforms

Another Qt installer(aqt) Release: Documentation: Test status: and Coverage: This is a utility alternative to the official graphical Qt installer, for

Hiroshi Miura 528 Jan 02, 2023
A Python package for Misty II development

Misty2py Misty2py is a Python 3 package for Misty II development using Misty's REST API. Read the full documentation here! Installation Poetry To inst

Chris Scarred 1 Mar 07, 2022
Play Wordle Bot - Wordle Bot written in python

Wordle Bot A Bot written in python with a CL Interface to guess adn solve Wordle

Prashant 1 Feb 25, 2022
Open a file in your locally running Visual Studio Code instance from arbitrary terminal connections.

code-connect Open a file in your locally running Visual Studio Code instance from arbitrary terminal connections. Motivation VS Code supports opening

Christian Volkmann 56 Nov 19, 2022
Terminal Colored Text for Python

Terminal Colored Text for Python

R3CKhi-**75 3 Sep 10, 2022
a GUI app base on warp-cli for linux

warp cloudflare gui a GUI app base on warp-cli for linux Installation read warp-cli install doc. install warp-cli and register with $ warp-cli registe

Moein Aghamirzaei 58 Jan 01, 2023
Runs a command in P4wnP1 and displays the output on OLED screen (SH1106)

p4wnp1-oled-terminal Runs a command in P4wnP1 and displays the output on OLED screen (SH1106) Works on Raspberry Pi Zero 2 W Tested successfully on RP

PawnSolo 1 Dec 14, 2021