DisabledMonkey Posted April 21, 2009 Share Posted April 21, 2009 (edited) Here's a version that can handle any punctuation you throw at it ?!@#&,. Edit: Mdiesel, I would like some "scambled" eggs too! : ) expandcollapse popup$text = "Overall, particularly Unintelligent people might discover serious problems whilst attempting converting scambled dialog including punctuation!!" MsgBox(48, "Can you read it?", _Scramble($text)) Func _Scramble($text) $letter = StringSplit($text,"") $count = 1 $startofWord = True dim $word[$letter[0]+1][2] For $n = 1 to $letter[0] If StringIsAlpha($letter[$n]) = 1 and $startofWord = True Then $word[$count][0] = $n $startofWord = False ElseIf StringIsAlpha($letter[$n]) = 0 and $startofWord = False Then $word[$count][1] = $n - 1 $startofWord = True $count += 1 ElseIf $n = $letter[0] Then $word[$count][1] = $n EndIf Next For $n = 1 to $count If $word[$n][1]-$word[$n][0] > 2 Then $wordBuff = "" $wordTest = "" For $i = 1 to $word[$n][1]-$word[$n][0] $wordBuff &= $letter[$word[$n][0]+$i] Next For $i = 1 to $word[$n][1]-$word[$n][0] $random = Random($word[$n][0]+1, $word[$n][1]-1, 1) $randomTwo = Random($word[$n][0]+1, $word[$n][1]-1, 1) $buff = $letter[$random] $letter[$random] = $letter[$randomTwo] $letter[$randomTwo] = $buff Next For $i = 1 to $word[$n][1]-$word[$n][0] $wordTest &= $letter[$word[$n][0]+$i] Next If $wordTest = $wordBuff Then $n -= 1 EndIf EndIf Next $text = "" For $n = 1 to $letter[0] $text &= $letter[$n] Next return $text EndFunc Edited April 22, 2009 by DisabledMonkey Link to comment Share on other sites More sharing options...
Mat Posted April 21, 2009 Share Posted April 21, 2009 disabledMonkey: your code looks even more impressive if you use this: $text = "Overall, particularly Unintelligent people might discover serious problems whilst attempting converting scambled dialog including punctuation!!" MsgBox(48, "Can you read it?", _Scramble($text)) long words work best, including 3 letter words does not work, such as wow. AutoIt Project Listing Link to comment Share on other sites More sharing options...
lordicast Posted April 21, 2009 Share Posted April 21, 2009 (edited) Spiff59's Version with some symbols BTW very nice and clean spiff59 I had to mess it up lol MsgBox (48, "Results", Scramble2('In Theory! Only 5% of people can read this, & others are not very smart "stupid" now give me some $ (money)')) Func Scramble2($stringin) Local $word, $stringout, $r, $i, $j $Sentence = StringSplit ($stringin, ',. !@#$%^&*:;"?/><|\[]{}=+-_`~1234567890') For $h= 1 to $Sentence[0] $Word = StringSplit($Sentence[$h], '') $j += $word[0] + 1 If $word[0] Then $stringout &= $Word[1] For $i= $Word[0] -1 to 2 Step -1 $r = Random(0, $i - 2) + 2 $stringout &= $Word[$r] $Word[$r] = $Word[$i] Next If $word[0] Then $stringout &= $Word[$word[0]] $stringout &= StringMid($stringin, $j, 1) Next Return $stringout EndFunc; ==> EDIT: YAY MY 100th POST YAY ME! Edited April 21, 2009 by lordicast [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
Spiff59 Posted April 21, 2009 Share Posted April 21, 2009 (edited) Spiff59's Version with some symbolslol I'd just gone back and edited in afew more punctuation characters myselfThough not to the extent that you have!Edit: BTW, thank you Edited April 21, 2009 by Spiff59 Link to comment Share on other sites More sharing options...
CodyBarrett Posted April 27, 2009 Author Share Posted April 27, 2009 Ok.. i have finished it... well.. except UNSCRAMMBLING the words... i have stringtohex.... stringtobinary and scrammblestring in there... i have uploaded the background GUI.bmp and there is ONE teeny tiny bug... the binary to string doesn't support white spaces.... ahwell updated at the top [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now