In [my first attempt] (https://gist.github.com/3745321) at writing an anagram solver, I stored my word list in a hash in which values
are words and keys
are characters in those words, sorted alphabetically.
I liked this approach, but my implementation was not ideal: I defined the creation of the hash as an activity that occurs when the #same_length_anagrams
method is called. This, of course, made it super slow!
This time I was able to structure things so that the word list hash is created when the program is initialized. The Ruby documentation for the #shell
class leaves a lot to be desired, but [this very helpful blog post] (http://devver.wordpress.com/2009/10/12/ruby-subprocesses-part_3/) on starting sub-processes in Ruby provided me with a great point of departure. My next step is to figure out how to clean up lines 1 - 12.
# Create word list hash