From: James Edward Gray II Date: 2005-12-06T00:58:44+09:00 Subject: Re: increasing counter whithin loop? On Dec 5, 2005, at 9:52 AM, Malte Milatz wrote: > ts: >> try it, with >> >> array = [ :a, :b, :c, :d, :e , :b] > > Huh. Right. So it becomes > > array.each_with_index do |x, i| > next if array[i-1] == :b unless i == 0 next if i > 0 and array[i - 1] == :b > print x, ' ' > end > > Nasty. James Edward Gray II