From: Paul Smith Date: 2009-09-29T05:49:49+09:00 Subject: Re: Noob - loop indexing On Mon, Sep 28, 2009 at 9:46 PM, Paul Smith wrote: > . > On Mon, Sep 28, 2009 at 9:43 PM, Simon Willard wrote: >> I try to make Ruby loops using "each" like this: >> >> # a is an array >> a.each do  ...  end > > a.each_index do |i| >  a[i]... > end Or a.each_with_index do |x, i| #here, x is a[i] puts x,i end