I wrote this while on a break from studying.
It basically jumbles the letters of each word but leaving the first and last letters untouched.
I'm sure you guys received emails with this (it's quite old):
Quote:
The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch 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.
Well, all my script does is that it transforms any text currently selected into a jumbled version and places it on the clipboard. Default hotkey is Win+z.
Code:
#z::
;Clear clipboard
Clipboard =
;Copy selection and wait for it to get to the clipboard
SendInput ^c
ClipWait
s := Clipboard
;Jumble words
i := 1
Loop {
i := RegExMatch(s,"P)[a-zA-Z]{4,}",l,i)
If Not i
Break
Else Jumble(s,i,l)
i += l
}
;Put back in clipboard
ClipBoard := s
Return
Jumble(ByRef s, pos, len) {
;Extract the middle letters
l := len - 2
t := SubStr(s, pos + 1, l)
;Jumble the letters
Loop {
;Get random number
Loop {
Random, r, 1, l
i := NumGet(t, r - 1, "UChar")
If i
Break
}
;Put the chosen letter in the next pos
NumPut(i, s, pos + A_Index - 1, "UChar")
NumPut(0, t, r - 1, "UChar")
If (A_Index = l)
Break
}
}