From: John Labovitz Date: 2006-09-24T15:31:27+09:00 Subject: Re: Help w/ Codegolf Total Triangles- reading input On Sep 23, 2006, at 11:12pm, Drew Olson wrote: > Thanks for the help...and with respect to white space, I apologize, I > was in the codegolf mindset and trying to conserve bytes. > http://www.codegolf.com Ah, then the compression is forgiven. ;) > Also, can you explain to me the difference between map and each? #each just evaluates the block for each element of the list (or whatever you're iterating over). You don't usually use the return value of #each. #map (aka #collect) also evaluates the block for each element, but returns a new list containing the return value of each evaluation. It's good for translating one set of values to another, like you were doing in your code. --John