Skip to content
The Chat Archive
gpt-4o-2024-05-13· OpenAI WildChat-4.8M (AI2)

"if we look at that word uh we see it’s nines so i’m going to put that into my code and…

  1. User

    "if we look at that word uh we see it’s nines so i’m going to put that into my code and run it in verbose mode so we can see exactly how it operates correct word nines and let’s make sure that’s in verbose so what do we see in our in our pattern here is that whatever letters we could correct in the first guess we always keep in the subsequent guesses so the second guess we see that um we have an i an s and an e in it because every single word in our dictionary has been filtered to match this result i mean that that seems to work pretty well until you get to this case where um every single word remaining in the dictionary looks like i n e s there’s nines dimes binds all these words and we just don’t get enough information with each subsequent guess because we’re limiting ourselves to using the same letters so we have five letters to play with and we’re only getting more information from the very first letter so i’ve already been kind of tinkering around and i’ve got an optimization here which it’s going to work like this we’re going to keep track of two lists of words one is going to be the answer space which contains the potential remaining word after it’s been filtered out each guess there’s going to be a second word list which is every single word in the dictionary that never gets filtered and what we’re going to do is build our letter frequencies so which words should we should we favor and try to pick that’ll be our answer space which continues to get filtered but the guess we’re going to do is going to be from all words so we’re going to pick a word that can get us more of these letters at a single time and not even worry about letters we’ve already picked it’s just gonna the whole goal is to filter the answer space down to a single word and then finally it’ll guess it so there we go we start with the same word and given those clues we filter the word list down so we still only have 248 words remaining in the dictionary but we pick a totally different word that doesn’t even contain any of the same letters so we’re actually getting way more information on the second guess we go from 248 words down to 15. if we look at this one we went from 248 down to 77 so we didn’t filter as much because we just didn’t get as much information so it’s still not perfect but we get get in eight guesses instead of thirteen so let me clear out uh we’ll go back to 100 games and not verbose and we’re not going to force it to be nines anymore and let’s see the overall average performance all right so we have improvement took an average of five guesses 5.1 guesses so that’s better than previously was over 5.3 and our worst case is only eight so we’re super close to being able to solve this 100 of the time but we have a couple seven and eight guesses which would push us over the limit for the game so let’s actually try this i’m going to turn my game into play mode and we’ll try it on today’s puzzle so let me i’m going to load today’s puzzle and let’s fire up the game so the first guess it wants me to do is acer and we see uh x x x y y next guess con tg and the game tells us that that word is not in the list so that’s not even a valid guess according to the game so we have a huge problem here our dictionary of guesses and possible answers does not match the game’s dictionary and possible answers so what i’m gonna have to do is figure out what words this game accepts make sure that our code uses the same exact list so we’ve done some digging in to the games code and we can see that it actually has the entire list of words uh right here and there’s something interesting which is that they have two lists one is a list of words you can type in and it’ll accept that as a guess the other is a list of words that it will use as potential answers and so if you want to go through this you can see where it where it picks a word for the answer in this function here so we know that um that first list is possible answers and this is the list that you’ll it’ll use for anything that can be typed in and accept it so i went ahead and downloaded those lists i copied those in to my own text file and so i have two lists now one is possible words these are actual answers that could be in the game and then there’s accepted words so these are words that you could type in and it’ll allow that and we already kind of have this in our code um we just did it in a different form because we started with the same word list so instead of loading one list we’re going to load both lists and i have my answer list which is the possible words and i’m never going to filter this or i’m going to filter this list as i go but the accepted words i’m never going to filter we’re always going to search through this list to pick our next best guess so let me go ahead and load this in all right here we are just by filtering that list down to the dictionary they provided we are at a magic 3.88 and only six gas worst case which means our program should be able to crack this 100 of the time got one last optimization plugged into the pick word function " Add punctuations to the above paragraph.

  2. Assistant

    Certainly! Below is your paragraph with added punctuation for better readability:


    "If we look at that word, uh, we see it’s 'nines.' So, I’m going to put that into my code and run it in verbose mode so we can see exactly how it operates. Correct word: 'nines.' And let’s make sure that’s in verbose mode. So, what do we see in our pattern here? Is that whatever letters we got correct in the first guess, we always keep in the subsequent guesses.

    So, in the second guess, we see that we have an 'i,' an 's,' and an 'e' in it because every single word in our dictionary has been filtered to match this result. I mean, that seems to work pretty well until you get to this case where every single word remaining in the dictionary looks like 'i,' 'n,' 'e,' 's.' There’s 'nines,' 'dimes,' 'binds,' and all these words. We just don’t get enough information with each subsequent guess because we’re limiting ourselves to using the same letters. So, we have five letters to play with, and we’re only getting more information from the very first letter.

    So, I’ve already been kind of tinkering around, and I’ve got an optimization here. It’s going to work like this: we’re going to keep track of two lists of words. One is going to be the answer space, which contains the potential remaining words after it’s been filtered with each guess. There’s going to be a second word list, which is every single word in the dictionary that never gets filtered.

    What we’re going to do is build our letter frequencies to determine which words we should favor and try to pick. That’ll be our answer space, which continues to get filtered. But the guess we’re going to make is from all words, so we’re going to pick a word that can get us more of these letters at a single time and not even worry about letters we’ve already picked. The whole goal is to filter the answer space down to a single word and then finally guess it.

    So, here we go. We start with the same word, and given those clues, we filter the word list down. So, we still only have 248 words remaining in the dictionary, but we pick a totally different word that doesn’t even contain any of the same letters. We’re actually getting way more information on the second guess. We go from 248 words down to 15. If we look at this, we went from 248 down to 77, so we didn’t filter as much because we just didn’t get as much information. It’s still not perfect, but we get it in eight guesses instead of thirteen.

    So, let me clear out that, and we’ll go back to 100 games, not in verbose mode, and we’re not going to force it to be 'nines' anymore. Let’s see the overall average performance. Alright, so we have improvement: it took an average of 5.1 guesses, which is better than the previous 5.3, and our worst case is only eight. We’re super close to being able to solve this 100% of the time, but we have a couple of seven and eight guesses which would push us over the limit for the game. So, let’s actually try this. I’m going to turn my game into play mode, and we’ll try it on today’s puzzle.

    So, let me load today’s puzzle and let’s fire up the game. The first guess it wants me to do is 'acer,' and we see 'x x x y y.' The next guess is 'contg,' and the game tells us that word is not in the list, so that’s not even a valid guess according to the game. So, we have a huge problem here: our dictionary of guesses and possible answers does not match the game’s dictionary and possible answers.

    So, what I’m gonna have to do is figure out what words this game accepts and make sure that our code uses the same exact list. We’ve done some digging into the game’s code, and we can see that it actually has the entire list of words right here. There’s something interesting: they have two lists. One is a list of words you can type in and it’ll accept that as a guess. The other is a list of words that it will use as potential answers.

    If you want to go through this, you can see where it picks a word for the answer in this function here. So we know that first list is possible answers, and this is the list that it’ll use for anything that can be typed in and accepted. So, I went ahead and downloaded those lists and copied them into my own text file. Now, I have two lists: one is possible words (these are actual answers that could be in the game) and then there’s accepted words (these are words that you could type in and it’ll allow that).

    We already kind of have this in our code; we just did it in a different form. So, instead of loading one list, we’re going to load both lists. I have my answer list, which is the possible words, and I’m never going to filter this—or I’m going to filter this list as I go. But the accepted words, I’m never going to filter. We’re always going to search through this list to pick our next best guess. Let me go ahead and load this in.

    Alright, here we are. Just by filtering that list down to the dictionary they provided, we are at a magic 3.88 and only six guesses at worst case, which means our program should be able to crack this 100% of the time. Got one last optimization plugged into the pick word function."


    This should improve the readability of the text.