pruby

Wordle opening method

Dec 28th, 2021 (edited)
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. I did two versions, in different languages, as my first implementation couldn't solve the second problem efficiently, and it was more fun.
  2.  
  3. The first version had to pick a valid word as a guess. The second was allowed to choose arbitrary letters.
  4.  
  5. Note these are scored slightly differently, because I had to change my method to efficiently solve the latter. All scoring is on an arbitrary scale, not by properly analysing bits of information yielded.
  6.  
  7. The "best word" is scored based on 2 points for exact matches, 1 point for a misplaced letter (maximum once per letter - not sure exactly how repeats are handled). Scores are added up across a wordlist of 5 letter words, from the English top 10k, and the highest scoring word chosen.
  8.  
  9. To find the best arbitrary pattern I needed to linearly separate the score components. This version scores 1 point for guessing a letter present in the word, and an extra point if the letter is in the right position. This is slightly different where letters are repeated. Again, added across a word list, but this version allowed me to pre-count how many words included an "a", etc.
Advertisement
Add Comment
Please, Sign In to add comment