class String
  def score
    total = 0
    # ascii 'a' is 97, 97-96 = 1
    self.strip.downcase.each_byte{|c| total += (c - 96)}
    total
  end
end

words = []
File.open("/usr/share/dict/words", "r") do |file|
  file.each_line {|line| words << line.strip}
end

ninetynine = words.find_all {|word| word.score == 99}   


  1. phoenyxblog posted this
To Tumblr, Love PixelUnion

We're updating Fluid!

Soon, we'll be updating the look and feel of this theme. Read about the changes here. You can easily turn off this notification in the theme customization panel.

Close