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.
Next, let's write a way to evaluate each guess given a known solution that returns data in this format.
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?
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).
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
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
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").
- [x] dark mode (critical)
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
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?