From: Dan Nachbar Date: 2011-09-04T23:08:42+09:00 Subject: Re: loops problem On Sep 4, 2011, at 9:46 AM, jack jones wrote: > for (j = @array.length ; j > counter ; j = j-1) # counter is a variable > @array[j+1] = @array[j] > end > > obviously this loop is invalid in ruby .. can any one tell me something > equivalent to it ? For this task, I would use #insert rather than iterating, as in @array.insert(counter,@array[counter]) Dan Nachbar