Skip to content

Instantly share code, notes, and snippets.

@ninjapanzer
Created February 28, 2013 20:04
Show Gist options
  • Save ninjapanzer/5059655 to your computer and use it in GitHub Desktop.
Save ninjapanzer/5059655 to your computer and use it in GitHub Desktop.
A toy that sums up a string
class WordCounters
def self.count_up_word word
count = 0
word.each_char do |l|
count = l.ord + count
end
count
end
end
puts WordCounters.count_up_word("pAul")
puts WordCounters.count_up_word("cOol")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment