Ok, yeah, that was the problem. Changing one line of code gives:
0 words in a string gives an average of 385 comparisons.
1 words in a string gives an average of 374 comparisons.
2 words in a string gives an average of 366 comparisons.
3 words in a string gives an average of 349 comparisons.
4 words in a string gives an average of 342 comparisons.
7 words in a string gives an average of 294 comparisons.
|
With the same number of words counted in each string. Huzzah! It is now fast enough to run well on ciphers of about the size we're considering.