From: Robert Dober Date: 2006-09-11T00:02:33+09:00 Subject: Re: How about Enumerable#find_pattern? ------=_Part_229710_13419466.1157900536124 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/10/06, A. S. Bradbury wrote: > > On Sunday 10 September 2006 15:04, Robert Dober wrote: > > class Array > > def pattern( *args ) > > l =3D args.length > > c =3D dup > > while c.first(l) !=3D c do > > c.shift > > return nil if c.length < l > > end > > length - c.length > > end > > end > > 'while c.first(l) !=3D c do' should of course be: > while c.first(l) !=3D args do > > Alex There is at least one guy reading my posts!!! Naturally, strange I tested my code, must have been a funny test :( Thx Robert --=20 Deux choses sont infinies : l'univers et la b=EAtise humaine ; en ce qui concerne l'univers, je n'en ai pas acquis la certitude absolue. - Albert Einstein ------=_Part_229710_13419466.1157900536124--