I havent programmed in rust in a while wanted to make something basic to get up to speed with it again
I have a strategy in wordle that I use and wanted to implement it in code.
most people when they find a letter than matches will only try words with that letter in that place
I think this is inefficient as our objective should be to narrow down the scope of what words are possible not confirm letters that we know for sure.
- Choose a word from a list of words
- character wise comparison and feedback of chosen word vs guessed word
- implement a solving algorithim, broadly using the strategy above
- Train a model to solve wordle(some kind of reinforcement learning thing is probably going to be best here you might be able to get away with a loss function where every letter match is -n, word match -m, and no match is 0)
- TUI to play yourself, with toggleable AI/algo help
- create and compare a bunch of these algorithims
I completed what I had planned, and my strat was by far the worst(when I programmed it wrong)
I had chatgpt implement a basic parrallelizing method in another branch I would like to give that a shot myself
After multithreading them, they are quite a bit faster to run through, I have really just done a first pass on multithreading though Not sure how much more I want to perfect/understand it quite yet
Ok, we got multithreading working well, enough time to move onto one of the three options I had for later down the line or move onto something else I might have a look at more wordle strats. Look on the internet and try to implement them. If I go with option 1. I want to use something with a ML lean aka not Rust, Something like mojo. I could look into a tui, but im not feeling motivated to do that atm, idk why.
So lets find/make some algorithims. https://www.poirrier.ca/notes/wordle-optimal/ They say with a decision tree based algo, you can solve the 12972 word dict with 4.077 guesses on average, I am running a ~9000 word dict, with a average of about 4.5 All of these appear to be a decision tree construction, something I kinda want to do in mojo.
One thing they talk about in comments following the strats are positioning of the chrs in the words limiting the search space further down the line and why one permutation of a set of letters is superior to another I want to try and build in the position of the letters into the heuristic, somehow.
it worked, but by golly it is slow it makes sense though, im looping through way too much. added a log term to the position to slightly deincentivize it, ill increase the log term to do this more, see if it helps at all log 2 seems to be the most based