From: ^-FakE-^ fake-or-dead Date: 2007-06-04T09:21:19+09:00 Subject: Re: [QUIZ] FizzBuzz (#126) ------=_Part_19489_1229774.1180916479007 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline irb(main):282:0> a = (1..100).inject([]){|hash, x| hash[x-1] = x unless x%3 ==0 || x%5==0 || x%15==0 ; hash[x-1] = 'Fizz' if x%3==0 ; hash[x-1] = 'Buzz' if x%5==0 ; hash[x-1] = 'FizzBuzz' if x%15==0 ; hash} irb(main):283:0> a.each{|x| p x} I like one line coding in ruby ^^ and sorry about my parameter name "hash" lazy to change >.< ------=_Part_19489_1229774.1180916479007--