Jump to content

solver


MMDE

Recommended Posts

I added some more options and fixed one tiny bug with one of the filters (related to dupe letters in the must contain filter).

 

Now you can decide what it starts or ends with, or if it has a double letter in it too! :) I added this, because it's quite common stuff in the game.

 

To exclude letters, just don't add them to the available ones! :D

 

Remember to set the "must contain counter", else "must contain" does nothing. Like if you set it to 2, it will make sure that all words contain at least two of the letters given. Not two of the same letter, but two of the letters given. If you want more than one of a letter, just add it twice.

 

The word list I've used contains 110k words. The game got some few words the word list doesn't, but that's rare, but what is more common is that like the plural form isn't found in the word list or something like that, but most of the time the plural version is there too.

 

For the treasure chests, just use the link at the top of the page linked to in the opening post.

Edited by MMDE
  • Like 3
Link to comment
Share on other sites

Before I finished the game I added even more extra features! Now you can easily add "all vowels" or "all consonants", either by using the drop down menu or just clicking on the field you want to apply the letters to and the drop down list should select that for you, after that it's just to click button for it, and you can add it more than once for things like "two vowels" or whatever! :D

 

Just to be clear, the starts with and ends with is just referring to what letter the very first letter must be, and you can specify more than one. So if you want a word that starts with a vowel, just add the vowels to that field!

 

For those wondering how this is programmed, because it's honestly not that straight forward, here's a short explanation.

 

You can't just search for a word that contains the letters specified, letters can be used more than once, but not more than how many of it that is specified. So what I did was just to make an array (a list with direct access depending on a key) of the letters with a count of how many times each character appear. PHP arrays work like a hashmap with string (text) keys, giving you direct access to check the count of each number if you know the letter. Hashmap is not very efficient, but you don't have that much choice in PHP, but in more traditional arrays, you could make an array of size 26. An entry for each letter in the alphabet, which you should do if you got a hashmap too, so you don't have to check if each key is set or not. Each letter has a number presentation too, and a is 97, so just subtract 97 from that and it will be 0 (first entry in an array). :P

 

So next you go through each word in the word list, each time making an array of the same size as the alphabet. For each word go through letter by letter and count them in the new array, and each time see if this count goes above the initial letter count. That way you keep track of if too many of each letter is used. The words that doesn't go above the initial letter count is valid matches! :D So you keep them and then just print them out later.

 

Of course I added more requirements to the matched words, most of which are done to each word after the initial match, so only doing it with the few words that actually matched the basic requirement.

 

Probably nobody who cares.

  • Like 2
Link to comment
Share on other sites

8 minutes ago, Komrade_Konrad said:

Thanks for this! I may end up using this tool to finish up the trophies.  I was going to do it just by myself, but it is seriously dragging on and I just want it over with at this point.

 

The real grind is the 3k letters. ;p The game is just not difficult at all with this tool. Always finding the best word quickly! :P 

Link to comment
Share on other sites

6 minutes ago, MMDE said:

 

The real grind is the 3k letters. ;p The game is just not difficult at all with this tool. Always finding the best word quickly! :P 

 

Oh I know the 3k word grind is the real problem, but I don't have to think hard at all about 3 letter words while I grind it out.  Currently have 8 normal stars and 30 challenge stars left I think?

Link to comment
Share on other sites

Just now, Komrade_Konrad said:

 

Oh I know the 3k word grind is the real problem, but I don't have to think hard at all about 3 letter words while I grind it out.  Currently have 8 normal stars and 30 challenge stars left I think?

 

yeah, just learn the normal 3 letter words. I fought the last boss over and over! Less restarting then, as he can take it.

Link to comment
Share on other sites

  • 1 year later...
On 1/6/2017 at 6:31 AM, MMDE said:

For those wondering how this is programmed, because it's honestly not that straight forward, here's a short explanation.

 

Many thanks for the tool. I used it quite a bit towards the end of the game when I just wanted to be done. Have you considered putting the code up on Github or anything? I was thinking it would be interesting to delve into.

Link to comment
Share on other sites

28 minutes ago, Aeir_ said:

 

Many thanks for the tool. I used it quite a bit towards the end of the game when I just wanted to be done. Have you considered putting the code up on Github or anything? I was thinking it would be interesting to delve into.

 

It's not the prettiest stuff you've ever seen. I can PM you it if you're interested.

Link to comment
Share on other sites

  • 3 years later...
  • 6 months later...
On 6/29/2022 at 4:16 PM, nicklasanielsen said:

Can you put the site online again? Or maybe share the source code for a local instance? :-)

 

I think I described the algorithm in an earlier post. It's at the very least fast enough for a word list of over a hundred thousand words.

 

I bet it could be done faster too, especially if you could keep the massaging of the word list in memory for second search etc. Like, it could "cache" each word with a linked list specifying the character and amount of each, that way you can easily check it against the characters you got. The ones you got gotta be the ones easy to access like the map / array idea I specified earlier. So basically, for each word, you look through the linked list, convert the character to the key for the map / array (preprocessed it to be a number if array) to fetch the count of that character you got and compare it to the count of the current character in the word to see if you got enough (is less or equal).

 

My brain tells me there is some way to do this with buckets and/or some kind of a graph, but I can't be arsed to think it through.

 

Actually:

I guess one way to do it is, each node represent a character and a count of it in the word. If you got x amount of A, then you can create all words with x or less As. So all nodes that represent x As or x-1 As etc, those you can "visit". Each node has a list of pointers to next nodes, and you gotta filter those you can visit. You'll want the storing of this node and traversing of it to be done using words that has been sorted alphabetical. So the word "memory" is stored like: 1e -> 2m -> 1o -> 1r -> 1y, and that's also how you gotta find the node. Run through the list on each node you "satisfy" and just dig deeper. On each node you store a list of words that you've "completed" to get to that node (that part of the graph).

 

No idea if that makes sense to anyone, but eh... Pretty sure it works.

Edited by MMDE
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...