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
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”.