in reply to Re^2: Challenge: 8 Letters, Most Words (2of12int.txt in 20^H^H 10 secs; Pure Perl)
in thread Challenge: 8 Letters, Most Words
It does recurse through all 8-letter combos, but short-circuits at each level if the combination so far cannot be derived from the dictionary supplied.
next unless exists $tree->{ $_ };
If the letter combination for your 'eehnortw' existed in the dictionary, it would be found very quickly:
[17:25:23.81] C:\test>type hdb.dict exactest one two three four five six seven eight nine ten torewhen [17:25:47.91] C:\test>1056884-calc hdb.dict 0.00380706787109375 [5] eehnortw : torewhen three one two ten [1] aceesttx : exactest
Comment out the short-circuit and it will consider all 8-letter possibilities .. and run more slowly.
|
|---|