Christian Genco Profile picture
Jan 6, 2022 β€’ 17 tweets β€’ 8 min read β€’ Read on X
Well this seems like a solvable problem.

Wordle 201 4/6

β¬›β¬›πŸŸ¨β¬›β¬›
⬛⬛⬛⬛⬛
πŸŸ©β¬›β¬›πŸŸ¨β¬›
🟩🟩🟩🟩🟩 Image
First step to a general solution: come up with a notation for storing the feedback I get from the game.

These two screenshots are, for my purposes, the same set of information. ImageImage
Next, let's write a way to evaluate each guess given a known solution that returns data in this format. ImageImage
Now we need a way to filter possible words given a set of guess results.

ie: given my record of previous guesses, which words could the actual word possibly be? ImageImage
With the above code in place solving every Wordle is pretty straightforward!

First `filterPossibilities` to get the array of possible solutions from your past guess results.

Then guess the most helpful next guess (the guess that minimizes the maximum remaining possibilities). Image
Although correct, this solution is *very* slow.

To speed it up, I can 1) make the algorithm multithreaded so it runs on each of my M1 Max's 10 cores, and 2) give up early on words that aren't going to beat my best case.

Let's try #2 first...
Oops that's not right Image
Heyyyyy there we go.

Turns out the best first word to guess in Wordle is "serai" ("In Eastern countries, an inclosed place for the accommodation of travelers").

No matter what the actual word is guessing "serai" willβ€”at worstβ€”leave you with only 697 remaining possibilities.
OH WHAT'S THIS looks like it's my favorite part of making stuff: scrape together just enough justification to buy *another* domain name πŸ₯³

Next steps:

- [ ] compute the tree of guesses to every word
- [ ] throw together a React app
- [ ] deploy Image
Movin' right along.

I decided against precomputing the tree of guesses since 1) now it runs reasonably quickly and 2) if I compute on the client side there's more flexibility (ex: "I've already made these three suboptimal guesses please tell me the next best guess"). Image
- [x] dark mode (critical) Image
Well would ya look at thatβ€”it's our old friend `guessResults`!

This time with a GUI 😎

Next I need to figure out input. I guess I'll just copy Wordle's virtual keyboard.

Then I need to connect the solver with the GUI which should be straightforward. Some UI to figure out.
Got a little sidetracked hunting for React animation libraries that I didn't hate and then making my own powered by animate.style

Now I can do:

<Animate render={({headShake}) => <input onChange={headShake} />} />

We're almost functional!
ALRIGHT we've got an actual usable product (spoilers for today's puzzle in the demo).

Wordle 202 4/6

πŸŸ©β¬›β¬›β¬›β¬›
πŸŸ¨β¬›β¬›β¬›πŸŸ¨
β¬›β¬›πŸŸ©β¬›β¬›
🟩🟩🟩🟩🟩

Time to deploy this baby and then maybe add @NathanG's github.com/leonardodino/r… input and make the top buttons actually do something.
It's unreasonably easy to deploy React apps on @vercel.
πŸ‘‹πŸ» Hey @powerlanguish I solved your game: wordlesolver.com
OH I'VE MADE A CRITICAL MISTAKE

There are actually *five* optimal guesses (each guess will, at worst, narrow down the possible list of words to only 168).

I didn't realize the Wordle wordlist was split into "possible answers" and "acceptable dictionary word guesses." Image

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Christian Genco

Christian Genco Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @cgenco

Dec 3, 2019
If you're feeling resentful and powerlessβ€”like people are walking all over you and you need to make them happy to feel betterβ€”you would benefit from practicing setting boundaries.

How do you set a boundary? MINI MENTAL HEALTH THREAD πŸ‘‡πŸ»
Boundary template: "When W, I feel X. I want Y, or else Z."

Let's break that down. First, identify the "if" in your "if...then" clause. You're drawing the line in the sand to communicate *precisely* where the boundary is.

"When:
* I notice the house is messy
* you insult me"
Next, own your feelings. This isn't about how the *other* person is mean, it's about you feeling hurt.

I can argue with you that I'm not mean. I can't argue that you feel hurt.

Try to be more descriptive than just "I feel bad." Do you feel dejected? Worthless? Resentful?
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(