From: Harry Kakueki Date: 2007-05-10T21:57:46+09:00 Subject: Re: loop questions On 5/10/07, Lloyd Linklater wrote: > > Which worked as expected. But I had better use for a descending loop. > In pascal it would be > > for i := 5 downto 1 do > writeln('%d', [i]); > > but I could not figure out how to do that in a for loop. I looked > through several books and could not find the answer. Any tips? > > -- > Is this what you want? 5.downto(1) do |x| p x end OR 5.downto(1) {|x| p x} Harry -- http://www.kakueki.com/ruby/list.html A Look into Japanese Ruby List in English