I'm sure most, if not all, of you have come across this at some point or another:
Aoccdrnig to a rscheeachr at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.
Create a program that inputs any amount of text. For testing purposes, use the unscrambled version of the above text, found below.
The program must then randomly transpose the letters of each word with a length of 4 or more letters, except the first and last letter of each word.
All other formatting must remain the same (capitalization and punctuation, etc.).
Testing text:
According to a researcher at Cambridge University, it doesn't matter in what order the letters in a word are, the only important thing is that the first and last letter be at the right place. The rest can be a total mess and you can still read it without problem. This is because the human mind does not read every letter by itself but the word as a whole.
As usual, this is a code-golf. Shortest code wins.
rscheearch
in your sample text. \$\endgroup\$don't
remain in the same position? The spec saysAll other formatting must remain the same (capitalization and punctuation, etc.).
but I'm not sure how that works out here... \$\endgroup\$