Jump to content

How your mind works.


scriptkitty
 Share

Recommended Posts

Ok, this script is based on a consept that I saw in an email a year or so ago. It showed a paragraph that mixed up all the letters in a word, but keeping the first and last in place. If you looked at it, it was a mess, but if you just read it, then it was perfectly readable.

I found it amusing, and the other day I thought to see if this would work for normal paragraphs and not just the one that was shown. So, why not let Autoit do my test for me.

This is just a fun script and should have a few bugs.

Here is the script, judge for yourself.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:    English
; Platform:    Win9x / NT
; Author:        Scriptkitty
;
; Script Function:
; This is based on the thought that your mind will rearange words
; as long as the first and last letters are right, and all of the letters
; are in the word.  Example, wrod if read fast would appear to be word as your mind
; will base it on context. Just for fun.  Copy a bunch of text into the clipboard and run it.
;
; To deal with various puntuations I did a cheep mickeymouse fix for now.
; ----------------------------------------------------------------------------

$clip=clipget()
;$clip="Hello there fine folks"
cheepfix1()
$words=StringSplit($clip," ")
$mixed=""
for $i=1 to $words[0]
   $jumble=jumble($words[$i])
   if $jumble=$words[$i] and stringlen($words[$i])>3 then 
      $i=$i-1
      ContinueLoop; this makes sure everything is mixed up.
   EndIf
   $mixed=$mixed & " " & $jumble
Next
cheepfix2()

msgbox(1,"Mixed up version",$mixed)
msgbox(1,"Normal version",$clip)

func cheepfix1()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$clip=StringReplace($clip,$x[$i]," "& $x[$i])
Next   
$clip=StringReplace($clip,@cr," "& @cr)
$clip=StringReplace($clip,@lf,@lf & " ")
EndFunc

func cheepfix2()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$jumble=StringReplace($jumble," " & $x[$i],$x[$i])
Next   
$jumble=StringReplace($jumble," "& @cr,@cr)
EndFunc


func jumble($_word)
   if stringlen($_word)<3 then return $_word
   $_letters=Stringsplit($_word,"")
   $_jumble=$_letters[1]
   $_used=" |"
   $_count=2
   while $_count<$_letters[0]
      tooltip($_jumble,0,0)
      $ran=int(random(2,$_letters[0]))
      if stringinstr($_used,"|" & $ran & "|")=0 then
         $_count=$_count+1
         $_used=$_used & $ran & "|"
         $_jumble=$_jumble & $_letters[$ran]
      EndIf
   WEnd
   return $_jumble & $_letters[$_letters[0]]
EndFunc

it does something like this:

---------------------------

Mixed up version

---------------------------

Ok, this sripct is based on a copsnet that I saw in an eiaml a year or so ago. It sewohd a parapgarh taht mxeid up all the lteters in a word , but kepneig the first and lsat in plcae. If you leokod at it, it was a mess, but if you jsut raed it, tehn it was peecrtlfy rdlbaeae.

I funod it aismung, and the ohetr day I tgohhut to see if tihs wuold wrok for nmoral parahgarps and not jsut the one that was sowhn. So, why not let Aitout do my tset for me.

Hree is the sprcit, jduge for yreulsof.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

  • Administrators

Ok, this script is based on a consept that I saw in an email a year or so ago. It showed a paragraph that mixed up all the letters in a word, but keeping the first and last in place.  If you looked at it, it was a mess, but if you just read it, then it was perfectly readable.

I found it amusing, and the other day I thought to see if this would work for normal paragraphs and not just the one that was shown. So, why not let Autoit do my test for me.

This is just a fun script and should have a few bugs.

Here is the script, judge for yourself.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:       English
; Platform:       Win9x / NT
; Author:         Scriptkitty
;
; Script Function:
; This is based on the thought that your mind will rearange words
; as long as the first and last letters are right, and all of the letters
; are in the word.  Example, wrod if read fast would appear to be word as your mind
; will base it on context. Just for fun.  Copy a bunch of text into the clipboard and run it.
;
; To deal with various puntuations I did a cheep mickeymouse fix for now.
; ----------------------------------------------------------------------------

$clip=clipget()
;$clip="Hello there fine folks"
cheepfix1()
$words=StringSplit($clip," ")
$mixed=""
for $i=1 to $words[0]
   $jumble=jumble($words[$i])
   if $jumble=$words[$i] and stringlen($words[$i])>3 then 
      $i=$i-1
      ContinueLoop; this makes sure everything is mixed up.
   EndIf
   $mixed=$mixed & " " & $jumble
Next
cheepfix2()

msgbox(1,"Mixed up version",$mixed)
msgbox(1,"Normal version",$clip)

func cheepfix1()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$clip=StringReplace($clip,$x[$i]," "& $x[$i])
Next   
$clip=StringReplace($clip,@cr," "& @cr)
$clip=StringReplace($clip,@lf,@lf & " ")
EndFunc

func cheepfix2()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$jumble=StringReplace($jumble," " & $x[$i],$x[$i])
Next   
$jumble=StringReplace($jumble," "& @cr,@cr)
EndFunc
func jumble($_word)
   if stringlen($_word)<3 then return $_word
   $_letters=Stringsplit($_word,"")
   $_jumble=$_letters[1]
   $_used=" |"
   $_count=2
   while $_count<$_letters[0]
      tooltip($_jumble,0,0)
      $ran=int(random(2,$_letters[0]))
      if stringinstr($_used,"|" & $ran & "|")=0 then
         $_count=$_count+1
         $_used=$_used & $ran & "|"
         $_jumble=$_jumble & $_letters[$ran]
      EndIf
   WEnd
   return $_jumble & $_letters[$_letters[0]]
EndFunc

it does something like this:

---------------------------

Mixed up version

---------------------------

Ok, this sripct is based on a copsnet that I saw in an eiaml a year or so ago. It sewohd a parapgarh taht mxeid up all the lteters in a word , but kepneig the first and lsat in plcae.  If you leokod at it, it was a mess, but if you jsut raed it, tehn it was peecrtlfy rdlbaeae.

I funod it aismung, and the ohetr day I tgohhut to see if tihs wuold wrok for nmoral parahgarps and not jsut the one that was sowhn. So, why not let Aitout do my tset for me.

Hree is the sprcit, jduge for yreulsof.

Cool, i remember that news article. Brains are funny.
Link to comment
Share on other sites

ok, I found a bug that keeps the check for a non mixed up word looping so here is a slight fix:

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:    English
; Platform:    Win9x / NT
; Author:        Scriptkitty
;
; Script Function:
; This is based on the thought that your mind will rearange words
; as long as the first and last letters are right, and all of the letters
; are in the word.  Example, wrod if read fast would appear to be word as your mind
; will base it on context. Just for fun.  Copy a bunch of text into the clipboard and run it.
;
; To deal with various puntuations I did a cheep mickeymouse fix for now.
; ----------------------------------------------------------------------------

$clip=clipget()
;$clip="Hello there fine folks"
cheepfix1()
$words=StringSplit($clip," ")
$mixed=""
$err=0
for $i=1 to $words[0]
   $jumble=jumble($words[$i])
   if $jumble=$words[$i] and stringlen($words[$i])>3 and $err<3 then 
      $i=$i-1
      $err=$err+1
      ContinueLoop; this makes sure everything is mixed up. with 3 tries
   EndIf
   $err=0
   $mixed=$mixed & " " & $jumble
Next
cheepfix2()

msgbox(1,"Mixed up version",$mixed)
msgbox(1,"Normal version",$clip)

func cheepfix1()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$clip=StringReplace($clip,$x[$i]," "& $x[$i])
Next   
$clip=StringReplace($clip,@cr," "& @cr)
$clip=StringReplace($clip,@lf,@lf & " ")
EndFunc

func cheepfix2()
$x=stringsplit(",'?!.></\@#$%&*()`{}[]","")
for $i=1 to $x[0]
$jumble=StringReplace($jumble," " & $x[$i],$x[$i])
Next   
$jumble=StringReplace($jumble," "& @cr,@cr)
EndFunc


func jumble($_word)
   if stringlen($_word)<3 then return $_word
   $_letters=Stringsplit($_word,"")
   $_jumble=$_letters[1]
   $_used=" |"
   $_count=2
   while $_count<$_letters[0]
      $ran=int(random(2,$_letters[0]))
      if stringinstr($_used,"|" & $ran & "|")=0 then
         $_count=$_count+1
         $_used=$_used & $ran & "|"
         $_jumble=$_jumble & $_letters[$ran]
      EndIf
   WEnd
   return $_jumble & $_letters[$_letters[0]]
EndFunc

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

HAHA I remember when that email was going around.

:idiot:

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Nice script, but for the record, there are some sentences that you just can't read. I remember someone disproved it by showing that we can kind of predict what the next word will be, or what type or word it would be. By adding in not commonly used words, especially adjectives, the sentence wasn't easily readable.

Anidroccg to crad cniyrrag lcitsiugnis planoissefors at an uemannd, utisreviny in Bsitirh Cibmuloa, and crartnoy to the duoibus cmials of the ueticnd rcraeseh, a slpmie, macinahcel ioisrevnn of ianretnl cretcarahs araepps sneiciffut to csufnoe the eadyrevy oekoolnr.

Or:

According to card carrying linguistics professionals at an unnamed, university in British Columbia and contrary to the dubious claims of the uncited research, a simple, mechanical inversion of internal characters appears sufficient to confuse the everyday onlooker.

Edited by ryeguy
Link to comment
Share on other sites

yea, basically 2004 would break it because I put a check to make sure the words were mixed up. 2004 would swich the first 0 with 0 and the word appeared to be the same, so it tried to mix it up again and again. The second version tries only a few times.

If it was something important, I would use the jumble function to test to see if the randoms came out to be in order, ie: |2|3|4|5| etc, and if that occured it would re run it. Easy enough, but this is no production, just a fun example of things you can do with AutoIt.

BTW @josbe, thanks, I got married and haven't been to the forums in a while. Nice to be back, although my code might have got a bit slacking :idiot:

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

yea, basically 2004 would break it because I put a check to make sure the words were mixed up. 2004 would swich the first 0 with 0 and the word appeared to be the same, so it tried to mix it up again and again. The second version tries only a few times.

If it was something important, I would use the jumble function to test to see if the randoms came out to be in order, ie: |2|3|4|5| etc, and if that occured it would re run it. Easy enough, but this is no production, just a fun example of things you can do with AutoIt.

BTW @josbe, thanks, I got married and haven't been to the forums in a while.  Nice to be back, although my code might have got a bit slacking :idiot:

<{POST_SNAPBACK}>

Congratulations on the marriage! I understand not being on the computer as much. It took me months to get back on the computer after I got married. We have been married 1 year and 5 months now.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

...

BTW @josbe, thanks, I got married and haven't been to the forums in a while.  Nice to be back, although my code might have got a bit slacking :idiot:

<{POST_SNAPBACK}>

Congrats. :D

Two little bugs..a leading white space and the separated number.(Not all cases)

Check this text:

version 2.0

The output is:

  verosin 2. 0

Link to comment
Share on other sites

Ok, I redid it, since folks seem to enjoy it. This version uses autoit to fine a word, and sends it to the mixup function. I added a simple if to test make sure there were no words that wouldn't get some mixing, and all puntuations should stay in tact.

Also has a bit less code, and not so mickey moused.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:    English
; Platform:    Win9x / NT
; Author:        Scriptkitty
;
; Script Function:
; This is based on the thought that your mind will rearange words
; as long as the first and last letters are right, and all of the letters
; are in the word.  Example, wrod if read fast would appear to be word as your mind
; will base it on context. Just for fun.  
; Copy a bunch of text into the clipboard and run it.
;
; To deal with various punctuations I did it character by character.
; ----------------------------------------------------------------------------


$clip=clipget()
$mixed=jumble($clip)

msgbox(1,"Mixed up version",$mixed)
msgbox(1,"Normal version",$clip)

func jumble($_text)
$out=""
$len=stringsplit($_text,"")
$word=""
for $i=1 to $len[0]
   if (asc($len[$i])>=65 and asc($len[$i])<=90) or_
      (asc($len[$i])>=97 and asc($len[$i])<=122)  Then; this checks to see if a letter.
      $word=$word & $len[$i]
   Else
      $test=mixup($word) & $len[$i]
      $out=$out& $test
      $word=""
   EndIf
Next
return $out
EndFunc

func mixup($_word)
   if stringlen($_word)<3 then return $_word
   $_letters=Stringsplit($_word,"")
   $_jumble=$_letters[1]
   $_used=" |"
   $_count=2
   while $_count<$_letters[0]
      $ran=int(random(2,$_letters[0]))
      if stringinstr($_used,"|" & $ran & "|")=0 then
         $_count=$_count+1
         $_used=$_used & $ran & "|"
         $_jumble=$_jumble & $_letters[$ran]
      EndIf
      if $_used=" |2|3|" Then; since random could be the normal order, I stop it
            $_letters=Stringsplit($_word,"")
            $_jumble=$_letters[1]
            $_used=" |"
            $_count=2
      EndIf
   WEnd
   return $_jumble & $_letters[$_letters[0]]
EndFunc

edit.. added a few notes to it. and line continuations for easier reading.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Ok, I redid it, since folks seem to enjoy it. This version uses autoit to fine a word, and sends it to the mixup function. I added a simple if to test make sure there were no words that wouldn't get some mixing, and all puntuations should stay in tact.

Also has a bit less code, and not so mickey moused.

Huhu :idiot: funny your Script Scriptkitty :D

Link to comment
Share on other sites

Dang, I should have spell checked my post! I think all the looking at mixed up words has warped my brain and the stuff I was typing looked right. :idiot:

Of course spell check wouldn't have told me I meant Find a word, etc, etc.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

Thanks for a really nice script. I tried it "much" to early in the morning.

I copy / pasted the code into a new script and saved it.

I was reviewing / then ran the code.

I forgot the script was in the clipboard and i had to do a doubletake of the result then a dope slap to admit yeah - that is what i asked it to do.

Again, nice!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...