From: Avdi Grimm Date: 2012-06-26T12:25:23+09:00 Subject: Re: working with two arrays --f46d043c806007a18c04c357a68d Content-Type: text/plain; charset=ISO-8859-1 On Mon, Jun 25, 2012 at 9:06 PM, skolo pen wrote: > What method could I use to do the following: > > people = ["person1","person2","person3"] > > issue = ["issue1","issue2","issue3","issue4","issue5","issue6"] > > person1 => issue1 > > person2 => issue2 > > person3 => issue3 > > person1 => issue4 > > person2 => issue5 > > person3 => issue6 > > people.cycle.take(issue.size).zip(issue) Note that this will produce an array of arrays. A Hash doesn't work for this because any given key can only appear once. --f46d043c806007a18c04c357a68d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Jun 25, 2012 at 9:06 PM, skolo pen <lists@ruby-forum.com>= ; wrote:

<= div>
people.cycle.take(issue.size).zip(issue)

<= /div>
Note that this will produce an array of arrays. A Hash doesn'= t work for this because any given key can only appear once.=A0
--f46d043c806007a18c04c357a68d--