Using information theory, this is the optimal wordle player

Last update: May 6, 2022

enwordle

Using information theory, this is the optimal wordle player. It is written in Rust and runs on the command-line.

Theory

When you pick a word in Wordle, the game responds with 1 of 243 responses. There are five spaces and three possible responses for each (not present, wrong place, right place). 5^3 = 243. You get the most information about the word if each response is equally likely — that is, in the language of information theory, the response has the most possible entropy.

At each step, this program figures out the words that will evoke the most entropy from Wordle. It even tells you how many bits of information you are likely to get from playing the word.

This is the optimal strategy if you assume all the words in the list are equally likely to be the answer. Other people have done similar systems that do not make this assumption: https://github.com/jonhoo/roget

Usage

I usually pick the first word on the list that I think the New York Times might actually use.

To run

cargo run --release

Example: playing for "brain":

Read 12947 words. Making table...
12947 possibilities
	1 tares: 6.20 bits
	2 lares: 6.15 bits
	3 rales: 6.12 bits
	4 rates: 6.10 bits
	5 teras: 6.08 bits
	6 nares: 6.07 bits
	7 soare: 6.06 bits
	8 tales: 6.06 bits
	9 reais: 6.05 bits
What word did you pick? (0 to quit)
4
What did wordle return? (0 = not present, 1 = wrong place, 2 = right place)
11000
306 possibilities
	1 brail: 4.43 bits
	2 drail: 4.41 bits
	3 grail: 4.40 bits
	4 brain: 4.38 bits
	5 groan: 4.38 bits
	6 coria: 4.36 bits
	7 moria: 4.36 bits
	8 drain: 4.36 bits
	9 aroid: 4.35 bits
What word did you pick? (0 to quit)
3
What did wordle return? (0 = not present, 1 = wrong place, 2 = right place)
02220
6 possibilities
	1 drain: 1.79 bits
	2 brain: 1.79 bits
	3 braid: 1.79 bits
	4 craic: 1.25 bits
	5 vraic: 1.25 bits
	6 fraim: 0.65 bits
What word did you pick? (0 to quit)
1
What did wordle return? (0 = not present, 1 = wrong place, 2 = right place)
02222
1 possibilities
	1 brain: 0.00 bits
No more possibilities

GitHub

https://github.com/hillegass/enwordle
You might also like...

Simple profiler scopes for wgpu using timer queries

wgpu-profiler Simple profiler scopes for wgpu using timer queries Features Easy to use profiler scopes Allows nesting! Can be disabled by runtime flag

May 25, 2022

Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering.

Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering.

Provok Text Renderer written in Rust using HarfBuzz for shaping, FreeType for rasterization and OpenGL for rendering. Input Provok is fed with a JSON

May 18, 2022

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Rustcraft is a simple Minecraft engine written in rust using wgpu.

Apr 4, 2022

Show puffin profiler flamegraph in-game using egui

Show puffin profiler flamegraph in-game using egui puffin is an instrumentation profiler where you opt-in to profile parts of your code: fn my_functio

Apr 18, 2022

Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions

Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions

Introduction Proof-of-concept of getting OpenXR rendering support for Bevy game engine using gfx-rs abstractions. (hand interaction with boxes missing

May 22, 2022

A framework for making games using Macroquad.

Omegaquad A framework for making games using Macroquad. After writing maybe 5 games and finding myself always going to the previous project to copy-pa

Apr 19, 2022

minesweeper-rs is a simple minesweeper game using Rust and windows-rs.

minesweeper-rs is a simple minesweeper game using Rust and windows-rs.

minesweeper-rs minesweeper-rs is a simple minesweeper game using Rust and windows-rs. Key Features TBA Quick Start TBA How To Contribute Contributions

Nov 24, 2021

Sci-fi run 'n' gun action RPG created in Rust, using Macroquad

Capstone - Twilight of the Archons This is an action/run 'n' gun RPG, created in Rust using macroquad. The future holds huge boss fights, and a mind-n

May 9, 2022

a Vietnamese gambling game using three dice

Near Cetificate Devoloper - Demo Vietnamese gambling game: Gourd-Fish-Shrimp-Crab On NEAR How to play Instead of showing one to six pips, the sides of

Dec 20, 2021
A wordle implementation that I made for a competition of wordle solvers

Wordle tester A wordle implementation that I made for a competition of wordle solvers. Runs tests using a list of words and outputs the total turns ta

Apr 11, 2022
An application that tries to solve a Wordle puzzle only by using clues

wordlebot An application that tries to solve a Wordle puzzle only by using clues. You decide the word to discover (if you want to compete with wordleb

Apr 10, 2022
2-player game made with Rust and "ggez" engine, based on "Conway's Game of Life"
2-player game made with Rust and

fight-for-your-life A 2-player game based on the "Conway's Game of Life", made with Rust and the game engine "ggez". Create shapes on the grid that wi

Oct 25, 2021
This is a tool for solving the excellent Wordle puzzle

Wordle Tool This is a tool for solving the excellent Wordle puzzle. It mainly exists as an exercise to learn the (by all accounts) equally excellent R

Jan 17, 2022
Eldrow: Wordle in Reverse

Eldrow: Wordle in Reverse Setup First you are gonna have to get Rust at rust-lang.org. Then, you will need to have nodejs installed. For the WebAssemb

Feb 22, 2022
A reimplementation of the excellent word game Wordle by Josh Wardle.

Paudle A reimplementation of the excellent word game Wordle by Josh Wardle. This version was created using Yew and Rust. I cribbed the colors and layo

Mar 28, 2022
Rushes are new ephemeral projects at Hive Helsinki. Wordle is the first in this series with 48 hours time window

Rushes are new ephemeral projects at Hive Helsinki. Wordle is the first in this series with 48 hours time window

Feb 24, 2022
A Wordle solving assistant

Wordler A Wordle solving assistant. What and Why? Affected by the virally memetic game wordle, but linguistically incapable of solving it, I set forth

Feb 18, 2022
Solves wordle optimally by means of set subdivision

rust-wordle-solver Solves wordle optimally by means of set subdivision Building and running You should probably use the release build, as the debug bu

Feb 22, 2022
GFA visualizer, GPU-accelerated using Vulkan

gfaestus - Vulkan-accelerated GFA visualization Demo: https://youtu.be/TOJZeeCqatk gfaestus is a tool for visualizing and interacting with genome grap

May 12, 2022