What?
Remember this nonesence, typoglycemia?
I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg The phaonmneal pweor of the hmuan mnid Aoccdrnig to rscheearch taem at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is taht the frist and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Such a cdonition is arppoiately cllaed Typoglycemia :)- Amzanig huh? Yaeh and yuo awlyas thought slpeling was ipmorantt!
Well, when you have insomnia and need something mindless and mildy interesting to keep from going mad you write crud like this --
(defun typos ( text / scramble middle rotate main )
(defun scramble ( codes )
(if (< (length codes) 4)
codes
(append
(list (car codes))
(rotate (middle codes))
(list (last codes))
)
)
)
(defun middle ( lst )
(cdr
(reverse
(cdr
(reverse lst)
)
)
)
)
(defun rotate ( lst )
(cons
(last lst)
(reverse
(cdr
(reverse lst)
)
)
)
)
(defun main ( text / punc codes result )
(setq punc
(vl-string->list
"\".?!:-,;/()[]{}\n\r\t "
)
)
(foreach code
(reverse
(vl-string->list
(vl-string-trim
" \t\n"
text
)
)
)
(cond
( (member code punc)
(if codes
(setq result
(cons
(scramble codes)
result
)
codes nil
)
)
(setq result
(cons
(list code)
result
)
)
)
( (setq codes
(cons
code
codes
)
)
)
)
)
(vl-list->string
(apply 'append
(if codes
(cons
(scramble codes)
result
)
result
)
)
)
)
(main text)
)
(typos "Now, whenever you feel the need to ...")
Now, wehenevr you feel the need to aonny yuor fdriens, or jsut slpel lkie Jhon, jsut psas yuor txet tghrouh tihs slimpe rnoutie!
Edit: Distilled routine.