Re: Semcarlbd letrtes sepur! (Scrambled letters super!)

Xavier Noria <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
On Thursday 18 September 2003 17:06, Sven Neuhaus wrote:
> On Thu, Sep 18, 2003 at 08:44:45AM +0100, Etienne Grossmann wrote:
> > PS : Ok, ok, the ublmaecsrnd sprict is :
> >
> > perl -pe 'sub r{join"",map chop,sort
> > map{rand().$_}shift=~/(.)/g};s/\b(\w)(\w*)(\w)\b/$1.r($2).$3/eg'
>
> Slhgit iomeevmnrpts
> perl -pe'sub r{join"",map chop,sort map
> rand.$_,split//,pop}s/(?<=\w)\w+(?=\w)/r($&)/eg' Tehre must be a
> beettr way...

My current favourite is

    -p s!\B\w+\B!join"",sort{rand 2}$&=~/./g!ge

but I am sure any serious golfer can shorten that substantially.
  
-- fxn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.