Anagrams - Combinations/Perumatations

Blitz3D Forums/Blitz3D Beginners Area/Anagrams - Combinations/Perumatations


you even don't need a "used field" when you simply check each character of a dictionary entry with INSTR to see if i's part of the orginal main word.


Well the letters that constitute the sub-word may simply be in the wrong order. 'Let Val sue I' is an (awfully crap) anagram of 'televisual' but INSTR would never recognise the presence of 'let', 'val' or 'sue' unless the source set was sufficiently reordered.


I also think it's wrong to generate a list of possible anagrams if you are going to remove those that are not part of the dictionary anyway.



Continuing with the above example, exploring every possible permutation would simply ensure that the original set was sufficiently reordered for INST to be helpful. Yes, you'd get a lot of crap to disregard that way, but somewhere along the line you will also get 'Let Val sue I' along with every other valid anagram... it's a brute force way of getting valid results into a set in a fairly easy to parse format.

Incidentally, the parser I posted would be better suited to a more elegant search as it does not need letters to be in the correct order in order to recognise dictionary entries. You could simply pull out all the sub-words and go on to see whether or not there are any perfect combinations. (The gold medal would be an engine that tested for perfect combinations that made at least some dim sort of syntactical sense).