Solves wordle optimally by means of set subdivision

Overview

rust-wordle-solver

Solves wordle optimally by means of set subdivision

Building and running

You should probably use the release build, as the debug build may be too slow

cargo build --release
./target/release/wordle-solver

Usage

The solver will output two types of words: candidate suggestions and candidate guesses, along with their scores. After doing that, it will wait on your input describing the word you picked and the Wordle outcome you got:

Example exchange (optimal candidate openers censored to avoid spoilers):

> Suggestions: 5758 [("<word>", -355.0), ("<word>", -366.0), ("<word>", -377.0), ("<word>", -393.0), ("<word>", -393.0), ("<word>", -395.0), ("<word>", -395.0)]
> Guesses: 5758 [("<word>", -355.0), ("<word>", -366.0), ("<word>", -377.0), ("<word>", -393.0), ("<word>", -393.0), ("<word>", -395.0), ("<word>", -395.0)]
<word> --+--
> Got word <word> and marks: --+--
> Suggestions: 5758 [("croon", -15.0), ("crony", -15.0), ("grout", -15.0), ("loony", -16.0), ("trunk", -17.0), ("croup", -17.0), ("troop", -18.0)]
> Guesses: 125 [("croon", -15.0), ("crony", -15.0), ("grout", -15.0), ("trunk", -17.0), ("croup", -17.0), ("troop", -18.0), ("grunt", -18.0)]
croon -oo--
> Got word croon and marks: -oo--
> Suggestions: 5758 [("plate", -3.0), ("youth", -3.0), ("depth", -3.0), ("unity", -3.0), ("dusty", -3.0), ("flute", -3.0), ("rusty", -3.0)]
> Guesses: 15 [("trout", -5.0), ("wroth", -5.0), ("group", -6.0), ("proud", -6.0), ("prowl", -6.0), ("troll", -6.0), ("grout", -6.0)]

Suggestions are words that don't necessarily conform to the constraints that Wordle has presented so far, but would reduce the set of possible words very well. Guesses are words that do conform to the constraints - they are also sorted by how well they will subdivide the remaining possible guesses

USAGE:
    wordle-solver [OPTIONS]

OPTIONS:
    -d, --dict <DICT>            Path to the word dictionary to use [default: words.txt]
    -g, --gambling <GAMBLING>    Use a gambling strategy (instead of a best-average case default)
        --guesses <GUESSES>      Path to a reduced guess dictionary to use
    -h, --help                   Print help information
    -p, --pessimistic            Use the worst case strategy (instead of best average case default).
                                 Good against Absurdle
    -V, --version                Print version information
    -w, --word <WORD>            Disables interactive mode and replays a game to guess the specified
                                 word

How does it work?

For each possible guess, we subdivide the set of words into different subsets based on what colors wordle would give us for that word. Then we score the words based on the subset sizes

  • By default, we score by the average amount of information a guess is most likely to yield
  • By passing --pessimistic you can get the best-worst-case guess (useful for playing Absurdle)
  • By passing --gambling you can get a percentile-case of your chosing (0 is worst case, 0.5 is median guess)

The worst case scenario is illustrated in a JamBoard presentation

You might also like...
Wordle, but with ZK proofs!
Wordle, but with ZK proofs!

Zordle: ZK Wordle Zordle is Wordle, but with zero-knowledge proofs. Zordle uses ZK proofs to prove that a player knows words that map to their shared

Femtorinth is a library to interact with a sub-set of the Modrinth API.

Femtorinth Femtorinth is a rust library to interact with a sub-set of the Modrinth api, it only includes the api calls that don't need auth (a.k.a onl

Morphosis is a work-in-progress set of tools to deal with Minecraft metadata, mainly for use with PolyMC.

Morphosis Morphosis is a work-in-progress set of tools to deal with Minecraft metadata, mainly for use with PolyMC. It consists of a library (metamorp

Cross-platform GPU-accelerated viewer for the Mandelbrot set and similar (escape-time) fractals

fractal_viewer A cross-platform, GPU-accelerated viewer for the Mandelbrot Set and related fractals. Try it online! Usage Scroll wheel to zoom, click

Explicitly set sprite layers for sprites in Bevy games.
Explicitly set sprite layers for sprites in Bevy games.

extol_sprite_layer lets you specify the drawing order for sprites in your Bevy game using a separate component rather than via the z-coordinate of you

A Rust library and cli for Wordle. Inspired by Wordle in Bash
A Rust library and cli for Wordle. Inspired by Wordle in Bash

A Rust library and cli for Wordle. Inspired by Wordle in Bash

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

🛠️ Uses zkevm-circuits and anvil mainnetfork to prove that a tx solves an EVM challenge

zk-proof-of-evm-execution This is a PoC developed at hackathon that enables a user to prove that they know some calldata that can solve a challenge on

Generic k-means implementation written in Rust

RKM - Rust k-means A simple Rust implementation of the k-means clustering algorithm based on a C++ implementation, dkm. This implementation is generic

"putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely.

Putzen "putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely. About In short, putzen solves

Druid Exporter plays a fundamental role as a receiver of metrics events coming from Druid clusters, adopting the HTTP format as a means of communication
Druid Exporter plays a fundamental role as a receiver of metrics events coming from Druid clusters, adopting the HTTP format as a means of communication

Druid Exporter plays a fundamental role as a receiver of metrics events coming from Druid clusters, adopting the HTTP format as a means of communication. In addition to this capability, its primary function is to export these metrics to Prometheus, thus allowing the creation of meaningful graphs and visualizations.

Druid Exporter plays a fundamental role as a receiver of metrics events coming from Druid clusters, adopting the HTTP format as a means of communication.
Druid Exporter plays a fundamental role as a receiver of metrics events coming from Druid clusters, adopting the HTTP format as a means of communication.

Druid Exporter plays a fundamental role as a receiver of metrics events coming from Druid clusters, adopting the HTTP format as a means of communication. In addition to this capability, its primary function is to export these metrics to Prometheus, thus allowing the creation of meaningful graphs and visualizations.

Given a set of kmers (fasta format) and a set of sequences (fasta format), this tool will extract the sequences containing the kmers.

Kmer2sequences Description Given a set of kmers (fasta / fastq [.gz] format) and a set of sequences (fasta / fastq [.gz] format), this tool will extra

Code to brute-force Wordle solutions

Wordle solver The idea of this is to find the optimal solution to Wordle puzzles. The current implementation, for each guess, works out the worst case

A solver for the popular Wordle game written in Rust.

Wordle Solver A solver for the popular Wordle game written in Rust. It does not attempt to be the most efficient solver possible but tries to avoid us

Wordlet - a command line clone of Wordle, written in Rust.
Wordlet - a command line clone of Wordle, written in Rust.

Wordlet Wordlet is a command line clone of Wordle, written in Rust. Installation $ cargo install wordlet Usage After installation, start Wordlet by ty

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

Simple wordle clone written in Rust.

wordle-rs A small wordle clone built in rust. Note: There are a lot of weird words I've never even heard in the dictionary file. If anyone knows a bet

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

Owner
Gorgi Kosev
Gorgi Kosev
"putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely.

Putzen "putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely. About In short, putzen solves

Sven Assmann 2 Jul 4, 2022
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

Brett Henderson 2 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

Xuming Zeng 8 Sep 16, 2022
Naive and quick Wordle optimal starting word Analysis.

wordlentropy Naive and quick Wordle optimal starting word Analysis. This Rust code can analyze all 2315 Wordle games with 10657 word choices in 100 mi

Mufeed VH 2 Feb 7, 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

Paul Sanford 39 Dec 5, 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

Jiri Novotny 1 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

alberto 4 Feb 18, 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

Rich Neswold 2 May 25, 2022
Using information theory, this is the optimal wordle player

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

Aaron Hillegass 2 May 6, 2022
An interactive, universal Wordle solver

Eldrow (Wordle in reverse) is an interactive, universal Wordle solver that attempts to achieve near to mathematically perfect performance without rely

agubelu 3 Sep 2, 2022