From: Robert Klemme Date: 2013-04-15T22:39:34+09:00 Subject: Re: simple lambda question --20cf3074d320d61d2104da6661e4 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Apr 15, 2013 at 2:53 PM, Hyun Oh K. wrote: > OMG! this is the simplest way! > Thank you! > Very simple... beautiful! > That's Ruby. :-) Here's another one - just for fun irb(main):003:0> 100.times {|a| s = (a * a).to_s; puts a, s if 2.times.all? {|i| s[2*i] == s[2*i+1]} } 88 7744 => 100 ;-) Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ --20cf3074d320d61d2104da6661e4 Content-Type: text/html; charset=ISO-8859-1



On Mon, Apr 15, 2013 at 2:53 PM, Hyun Oh K. <lists@ruby-forum.com> wrote:
OMG! this is the simplest way!
Thank you!
Very simple... beautiful!

That's Ruby. :-)

Here's another one
- just for fun

irb(main):003:0> 100.times {|a| s = (a * a).to_s; puts a, s if 2.times.all? {|i| s[2*i] == s[2*i+1]} }
88
7744
=> 100

;-)

Cheers

robert


--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
--20cf3074d320d61d2104da6661e4--