Skip to content

Instantly share code, notes, and snippets.

@moosan63
Created October 30, 2012 23:43
Show Gist options
  • Save moosan63/3983851 to your computer and use it in GitHub Desktop.
Save moosan63/3983851 to your computer and use it in GitHub Desktop.
word counting program written by ruby
words = 0
open (ARGV[0]) do |file|
while l = file.gets
l = l.chomp
puts l
words += l.size
end
end
puts "\n"+words.to_s + "words"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment