Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Drunken words

by andye (Curate)
on Jan 30, 2009 at 18:54 UTC ( #740272=note: print w/ replies, xml ) Need Help??


in reply to Re: Drunken words
in thread Drunken words

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 ;


Comment on Re^2: Drunken words
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-04-21 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (495 votes), past polls