Anagram Solver?

How do I…

Check if a group of letters can be rearranged to spell any word which exists within a dictionary txt file.

What is the expected result

Anagram solver.
Example: Player has 5 random letters, stored in a variable. For example “drasc”
The dictionary is checked to see if there are any 5-letter words in the dictionary which contain those 5 letters. It will find “cards” and provide this as feedback to the player. If there is more than one word found then one of those words is randomly selected and displayed.

This link is about making one for android but the technique can be adapted.

The concepts is you compare a word to the words in your dictionary or word list but first you sort the letters in each word alphabetically.

Instead of comparing “cat” to “act”, you would rearange the letters alphabetically. So, it would compare “act” to “act”.

1 Like

Great, thanks. With the help of some AI i patched together a working javascript anagram solver with a 200k dictionary… I have to read up how to get it to function properly in unison with my game after it’s been pasted into Gdevelop.