2009-11-26, 04:45 AM
Sivrat Wrote:i know, thats why the boolean expressions are [i] == '\0', which is the void statement for strings.
and @ devil's sunrise, even if a subsequence isnt necessarily and substring, it matters not. The test is to figure out if the word is in the dictionary.txt file, spelled correctly. If it isnt i'm to offer suggestions that either make it a matchscore less then 3 with same wordlength, a permutation with same wordlength, or subsequence or a substring with wordlength within 2. If it would test true for substring, then even if i deleted that test completely it would still test true for subsequence, making it somewhat unnecessary.
But the sorting the permutations seems like not a bad idea, just think there is a somewhat easier way, but since i can't figure out how to do loops to test correctly, i suppose that's a workaround i can try.
There are some other ways I can think of right now, both seem to be possibly faster:
Set up two arrays with 256 slots.
Whenever "a" is found in any string, increase the "a"-value for that string's array. Do that for all values. When null is found, check that the two arrays you've made is equal.
Set up a list or a hash-array. Repeat the same thing as written above.

