|
Scrambled letters, clear meaning
|
Social links
Class::Prototype
WWW::Spyder Javascript tricks serial() join function Smart quotes Text to Excel Developing Featherweight Web Services with JavaScript
Miscellaneous
|
|
| Scrambled letters, clear meaning
|
Description Accondrig to raercesh w’ree pprniaarsahg hree, it deso’nt mteatr in waht oerdr the ltteers in a word apaper. The msot iapontmrt thnig for cnemoperhosin is that the first and last lrtetes are in the rihgt pacle. The rset can be celpoltemy out of oredr and ntiave skeepras can sltil read it whtiuot any soierus diulfficty. Code my $text = join '', <DATA>; while ( $text =~ /(['\w]+)((?:\s+|[-[:punct:]]|\z)+)/g ) { my ( $word, $filler ) = ( $1, $2 ); my @piece = split //, $word; shuffle(@piece[1..$#piece-1]) if @piece > 2; print join('', @piece), $filler; } exit 0; #===================================================================== sub shuffle { for ( my $i = @_; --$i; ) { my $j = int(rand($i+1)); @_[$i,$j] = @_[$j,$i]; } } #===================================================================== __DATA__ According to research we're paraphrasing here, it doesn't matter in what order the letters in a word appear. The most important thing for comprehension is that the first and last letters are in the right place. The rest can be completely out of order and native speakers can still read it without any serious difficulty. Discussion I’ve know this since I was a kid, though it was brought back to my attention by the lovely and talented Jamie Zawinski. The reason I knew it already is an accidental manifestation of this phenomenon drove me half batty with confusion when I was 13 and read the Lord of the Rings trilogy for the first time. I thought Sauron and Saruman were the same person. S-a-u-or-r-or-ur-something-n. |
|
|
Perl Books ·
CPAN ·
mod_perl ·
Perl Monks ·
Perl Mongers ·
Perl Journal ·
Use Perl ·
Perl Jobs ·
ActiveState ·
perldoc.perl.org ·
O’Reilly Perl ·
W3Schools tutorials ·
Ovid's CGI Course ·
Catalyst ·
Perl at Wikipedia
Text, original code, fonts, and graphics ©1990-2008 Ashley Pond V. |
||