Word Scrambler, Write-Only Version
Categories: [ IT ]
Here's a more compact, less readable version of the scramble function:
sub scramble { return $_[0] if $_[0] =˜ /ˆ[A-Z]/; my @l = split //,$_[0]; @l[1..$#l-1] = sort { rand(1) < 0.5 ? -1 : 1 } @l[1..$#l-1]; return join("", @l); }
[ Posted on August 28th, 2008 at 00:05 | no comment | permanent link ]