From: Robert Klemme Date: 2011-11-05T19:53:41+09:00 Subject: Re: Ruby Challenge On Sat, Nov 5, 2011 at 3:40 AM, teresa nuagen wrote: > Here is a ruby challenge for all you computer science lovers out there, > lets see how many ways we can solve this problem: > > create a word frequency generator; that is, a program that takes in a > text file and generates a list of words and counts (you know, pairs of > things). Lets say you have a text file. > > If the text file contained this sentence, the output of your program > would look something like this: > > 1 contained > 1 file > 1 if > 1 like > 1 look > 1 of > 1 output > 1 program > 1 sentence > 1 something > 1 text > 1 would > 1 your > 2 the > 2 this > > Consider a "word" to be any space-delimited token. How would you also do > this with punctuation included? Now, where's the challenge? I rather get the impression that you want to make other people do your work by spicing the task with the word "challenge". If that should indeed be the case please be aware that this kind of behavior is not appreciated in our community. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/