Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Drunken words

by linuxer (Curate)
on Jan 29, 2009 at 23:52 UTC ( [id://740077]=note: print w/replies, xml ) Need Help??


in reply to Drunken words

Waht deos bteter mean hree ? Atneohr solotiun :

#!/usr/bin/perl -w use strict; use List::Util qw(shuffle); s<^(\w?)(.+?)(\w?)$><print+(join('',$1,shuffle(split//,$2),$3,' '))>e +for @ARGV; print "\n";

Replies are listed 'Best First'.
Re^2: Drunken words
by andye (Curate) on Jan 30, 2009 at 18:54 UTC
    or

    #!/usr/bin/perl -w use strict; use List::Util qw(shuffle); print map { join '', $_->[0], shuffle(@{$_}[1 .. $#$_-1]), $_->[$#$_], + ' ' } map { [ split // ] } @ARGV ;

    although that doesn't really work for 1-letter words

    update

    #!/usr/bin/perl -w use strict; use List::Util qw(shuffle); print map { !$#$_ ? $_->[0].' ' : join '', $_->[0], shuffle(@{$_}[1 .. + $#$_-1]), $_->[$#$_], ' ' } map { [ split // ] } @ARGV ;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2024-04-18 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found