------art_34860_23418248.1145722868588
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

"text".gsub(/\B(\w{2,})\B/) { |s| s.length.times { |i| r = rand(s.length);
s[i], s[r] = s[r], s[i] }; s }

It is one line, but it does have a couple of semi-colons.

On 22/04/06, Ross Bamford <rossrt / roscopeco.co.uk> wrote:
>
> On Sun, 2006-04-23 at 00:56 +0900, Ray Baxter wrote:
> > Ross Bamford wrote:
> >
> > > This is a better example:
> > >
> > > [rosco@jukebox text-munger-76]$ ./munger.rb test2.txt
> > > La viiosn euro˝¤epne str˝╚iatque
> > > [rosco@jukebox text-munger-76]$ ./munger.rb test2.txt
> > > La vioisn eurpe˝¤one strga˝╩tque
> > > [rosco@jukebox text-munger-76]$ ./munger.rb test2.txt
> > > La vioisn eurenop˝¤e strtagi˝Ďue
> > > [rosco@jukebox text-munger-76]$ ./munger.rb test2.txt
> > > La vision eurpe˝đnne str˝╩gatque
> > > [rosco@jukebox text-munger-76]$ ./munger.rb test2.txt
> > > La vision eur˝đnpene strgt˝╩aque
> > > [rosco@jukebox text-munger-76]$ ./munger.rb test2.txt
> > > La visoin eure˝đnpne striagt˝Ďue
> > >
> > > (from La vision europ˝Ănne strat˝╚ique)
> > >
> >
> > The pattern, "eu??????ne str?????que" is constant in your results.
> >
>
> Well, that's a question of more random, or more readable. A good point
> was raised about longer words becoming unrecognisable when just randomly
> scrambled...
>
> OTOH If we're doing random scrambling, leaving only first and last
> letter I think I can get back down to two lines...
>
> What's everyone else doing?
>
> --
> Ross Bamford - rosco / roscopeco.REMOVE.co.uk
>
>
>

------art_34860_23418248.1145722868588--