From: why the lucky stiff Date: 2002-08-21T06:11:13+09:00 Subject: Re: the power of ruby Yours is rather succinct, but I find that you can often capitalize on return values of methods to shorten. Shorten, right? You're looking for shorter? Here's one: WIDTH = 78 def do_dot( i ) puts( ( " " * i ) + "*" ) end loop { WIDTH.times { |i| do_dot(i) }.downto(0) { |i| do_dot(i) } } Check ya later. _why AW (sturmpanzer@metacrawler.com) wrote: > > Here is my unimaginitive attempt. > > [code]============================================== > WIDTH=78; > def do_dot(i) > i.times{print " "} > puts "*"; > end > loop{ > 0.upto(WIDTH-1){|i| > do_dot(i); > } > WIDTH.downto(1){|i| > do_dot(i); > } > } > [/code]=============================================