From: David Alan Black Date: 2002-03-06T08:14:54+09:00 Subject: Re: How to implement each_continuous_range Hello -- On Wed, 6 Mar 2002, andrew queisser wrote: > I'd like to implement an iterator that returns all ranges of > successive elements of an array. If an array consists of [1,2,3,5,6] > the iterator should return 1,3 and 5,6. I don't care whether the > iterator returns an array with two elements or two values. So far I > have this: You might have a look at: http://www.rubygarden.org/ruby?CodingChallenge0001 which was a problem very similar to this. Some of the solutions might give you some ideas. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav