Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Scrambling help

by Anonymous Monk
on Jan 27, 2015 at 21:53 UTC ( [id://1114675]=note: print w/replies, xml ) Need Help??


in reply to Re: Scrambling help
in thread Scrambling help

Come on! That smells like C. Not enough line noise, IMO! We obviously need regex :)
use strict; use warnings; sub scramble { lc $_[0] =~ s{(^.{$_[1]}|.{$_[1]}$)} {join '', (split '', $1)[map -$_, 1..$_[1]]}reg; } print scramble( "Institute", 3 ), "\n"; print scramble( "Babraham", 2 ), "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1114675]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-29 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found