Code to brute-force Wordle solutions

Overview

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 number of possible solutions if we receive a particular result. We can use this to heuristically steer finding optimal solutions.

Solutions

A word can be uniquely determined in 5 guesses (that is, the fifth guess is guaranteed to be correct). There are probably lots of words that can be used as starters to guess successfully in 5 guesses, but I haven't brute-forced that list. I know "aesir" can be used as a first guess.

A word cannot be uniquely determind in 4 guesses - an exhaustive search shows this. This search took circa 11 hours on the 4 cores of my early 2015 MacBook Air, demonstrating the trade-off between ancient hardware, time optimising code, and waiting for a computation to complete.

It's much faster to show that some word can be used as a starting point for a 5-guess solution than to show no 4-guess solution exists, because the former allows a heuristic to find an actual answer quickly, while the latter requires an exhaustive search to show no solution exists.

Next steps

Potential follow-up projects:

  • Find the best starting words, for some metric, like "fraction of words that can be solved by guess number 4".
  • Build an actually useful solver, rather than something that just says "a solution exists". It would take your guesses and the replies, and list potential solutions and suggested guesses.
  • Write up the algorithm in a bit more detail in this README.md.

Sources

The words in the words directory are sourced from the Wordle game itself, so that we're solving the actual real game. The scoring algorithm is reverse-engineered from its JS.

You might also like...
Simplified glue code generation for Deno FFI libraries written in Rust.

deno_bindgen This tool aims to simplify glue code generation for Deno FFI libraries written in Rust. Quickstart # install CLI deno install -Afq -n den

Dynamically invoke arbitrary unmanaged code.

DInvoke_rs Rust port of Dinvoke. DInvoke_rs may be used for many purposes such as PE parsing, dynamic exported functions resolution, dynamically loadi

Easy to use Rust i18n library based on code generation

rosetta-i18n rosetta-i18n is an easy-to-use and opinionated Rust internationalization (i18n) library powered by code generation. rosetta_i18n::include

A document-code sync tools for document engineering.

Writing A document-code sync tools for document engineering. Writing 是一个自动 “文档-代码” 同步工具。解析 Markdown 中的代码定义,读取目标代码,并嵌入到新的文档中。 Language parse support by

Clean up the lines of files in your code repository

lineman Clean up the lines of files in your code repository NOTE: While lineman does have tests in place to ensure it operates in a specific way, I st

A simple code boilerplate generator written in Rust.

💻 Cgen What is Cgen? A modern, cross-platform, multi-language boilerplate generator aimed to make your code generation less hectic! If you wish to su

Experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code

Diplomat is an experimental Rust tool for generating FFI definitions allowing many other languages to call Rust code. With Diplomat, you can simply define Rust APIs to be exposed over FFI and get high-level C, C++, and JavaScript bindings automatically!

A code coverage tool for Rust projects

Tarpaulin Tarpaulin is a code coverage reporting tool for the Cargo build system, named for a waterproof cloth used to cover cargo on a ship. Currentl

Rust macro that uses GPT3 codex to generate code at compiletime

gpt3_macro Rust macro that uses GPT3 codex to generate code at compiletime. Just describe what you want the function to do and (optionally) define a f

Owner
Simon Frankau
Simon Frankau
My solutions to the Advent of Code 2020.

AdventofCode2021 My solutions to the advent of code event 2021. For this edition I chose to solve the puzzles using Rust ?? . Day Name Link Solution 1

Lars Leijten 1 Dec 22, 2021
My solutions to the advent of code 2021 problems.

Advent of Code 2021 My solutions to the AOC 2021 problems in Rust. Solutions Task Status Day 1 ✔️ , ✔️ Day 2 ✔️ , ✔️ Day 3 ✔️ , ✔️ Day 4 ✔️ , ✔️ Day 5

null 1 Dec 25, 2021
Cargo-BOJ: test and submit solutions to BOJ problems

Cargo-BOJ Test and submit solutions to BOJ (Baekjoon Online Judge) problems. Defaults are geared towards Rust solutions, but non-Rust usage is support

null 5 Apr 3, 2023
Migrate C code to Rust

C2Rust helps you migrate C99-compliant code to Rust. The translator (or transpiler) produces unsafe Rust code that closely mirrors the input C code. T

Immunant 3k Jan 8, 2023
Mix async code with CPU-heavy thread pools using Tokio + Rayon

tokio-rayon Mix async code with CPU-heavy thread pools using Tokio + Rayon Resources Documentation crates.io TL;DR Sometimes, you're doing async stuff

Andy Barron 74 Jan 2, 2023
Waits until the exit code of a program is zero

Waitz A rust utility to wait that a program exits with 0. You need to wait for something to start up and don't know when it finishes?

Max Strübing 15 Apr 10, 2022
Sample code for compute shader 101 training

Sample code for Compute Shader 101 This repo contains sample code to help you get started writing applications using compute shaders.

Google Fonts 332 Jan 1, 2023
Detect if code is running inside a virtual machine (x86 and x86-64 only).

inside-vm Detect if code is running inside a virtual machine. Only works on x86 and x86-64. How does it work Measure average cpu cycles when calling c

null 34 Oct 3, 2022
Doku is a framework for building documentation with code-as-data methodology in mind.

Doku is a framework for building documentation with code-as-data methodology in mind. Say goodbye to stale, hand-written documentation - with D

ANIXE 73 Nov 28, 2022
A tool to run web applications on AWS Lambda without changing code.

AWS Lambda Adapter A tool to run web applications on AWS Lambda without changing code. How does it work? AWS Lambda Adapter supports AWS Lambda functi

AWS Samples 321 Jan 2, 2023