From: William James Date: 2008-02-16T15:19:55+09:00 Subject: Re: My Boggle Solver: I welcome any tips and tricks! On Feb 15, 11:34 pm, Stedwick wrote: > $words = {} > $stems = {} > File.open("enable.txt","r").each do |line| > word = line.chomp > $words[word] = true > > 0.upto(word.size-2) do |i| > $stems[word[0..i]] = true > end > end IO.foreach("enable.txt"){|word| word.strip! $words[word] = true (0...word.size).each{|i| $stems[ word[0,i] ] = true } }