Dave-Skinner / wordle-solver

Solver for Wordle game
1 stars 0 forks source link

Optimisation #1

Open mike-snow opened 2 years ago

mike-snow commented 2 years ago

Hey Dave, My colleague Peter mentioned you had talked on the Guardian page. He asked me to pass on a few findings we had playing around with this:

  1. The solution set the app uses is reduced to around 2000 words, and plurals are not included. This changes the optimal first guess from something like tares to stale
  2. The optimal guesses are usually from a combination from the first two words - e.g. covering as many popular letters as possible if the first guess isn't great, to leave the best possible chance of guessing correctly on the third/fourth attempt

Be great to connect on LinkedIn if you have a profile - mine is here: https://www.linkedin.com/in/michael1snow/

Happy New year! Mike

Dave-Skinner commented 2 years ago

Hi Mike,

  1. That's interesting. Did you extract the solution set from the js file, if so could you share it? I read somewhere else that there were only 178 words in the solution set. Do you know if the developer has changed that recently as the game got popular?

  2. That is effectively what this solver tries to do. At each turn, it counts the frequency of letters in each ordinal position in the remaining solution set. It then tries to find the guess word with the most possible solutions based on those frequencies. Theoretically, we should be able to search the whole decision tree at each guess to pick the optimal solution. Just pick the branch with the most possible solutions. My laptop doesn't fancy that though.

I just sent a connection on linkedin.

Cheers,

Dave

mike-snow commented 2 years ago

Hey Dave,

Ignore my scrappy code, I just played around with it for a few hours, but you can find the solution set here https://github.com/mike-snow/wordle in the pickled solutions file. The test_set pickle contains all the other words that are allowed to be inputted. If you combine the sets, then you get 'tares' as optimal, if you only use the solutions set, you get something like stale or stare. But it's definitely cheating as it narrows down the set so much!

I did a similar thing; I made a scoring function that weights having correct letters and correct letters in the right position w.r.t. all the words left in the solution set, so it picks the word based on frequency as well. It's a naive first try, and there's lots of ways to optimise, but it's a fun problem!

Just FYI, I've just joined a new company called Metyis who are building a data practice in London - Peter is my boss. Might be of interest to you?

Best, Mike

Michael Snow Data Science Consultant Snow Predictive Analytics Ltd.


From: Dave-Skinner @.> Sent: 05 January 2022 11:23 To: Dave-Skinner/wordle-solver @.> Cc: Mike @.>; Author @.> Subject: Re: [Dave-Skinner/wordle-solver] Optimisation (Issue #1)

Hi Mike,

  1. That's interesting. Did you extract the solution set from the js file, if so could you share it? I read somewhere else that there were only 178 words in the solution set. Do you know if the developer has changed that recently as the game got popular?

  2. That is effectively what this solver tries to do. At each turn, it counts the frequency of letters in each ordinal position in the remaining solution set. It then tries to find the guess word with the most possible solutions based on those frequencies. Theoretically, we should be able to search the whole decision tree at each guess to pick the optimal solution. Just pick the branch with the most possible solutions. My laptop doesn't fancy that though.

I just sent a connection on linkedin.

Cheers,

Dave

— Reply to this email directly, view it on GitHubhttps://github.com/Dave-Skinner/wordle-solver/issues/1#issuecomment-1005558932, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHA5FX2US5VG4QHPIQFW23DUUQLZPANCNFSM5LJO25DQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>