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

Bart Lateur <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Organization MediaMind
Message-ID <[email protected]>
On Thu, 18 Sep 2003 08:44:45 +0100, Etienne Grossmann wrote:

>perl -pe 'sub r{join"",map chop,sort map{rand().$_}shift=~/(.)/g};s/\b(\w)(\w*)(\w)\b/$1.r($2).$3/eg'

I like the way you scramble the array. Very nifty.

For  those people interested in this, I'd like to point out that there's
a thread on Perlmonks as well: 

	Txet Maglning Glof, Ayobndy?
	<http://perlmonks.org/index.pl?node_id=291720>

Especially the idea of using the /\B/ anchor appeals to me.
 Hmm... let's try it:

: perl -pe 'sub r{join"",map chop,sort map{rand.$_}shift=~/(.)/g};s/\B(\w+)\B/r$1/eg' 


-- 
	Bart.
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.