Jump to content

Fun with Unicode


Creator
 Share

Recommended Posts

Here's a little script for fun with unicode chars. This joke must exist about 500 years now, but i thought it would be nice to do a javascript to autoit port.

ʎ11ɐɔısɐq uʍop ǝpısdn ʇxǝʇ sʇnd ʇı :whistle:

Minimum version of autoit required: 3.2.4.0 (Unicode support)

Grtz

Creator

Updated with upside down '.' ( ChrW(176) )

fliptext.au3

Edited by Creator
Link to comment
Share on other sites

Got:

C:\Dokumente\Skript\AutoIT\fliptext.au3(36,19) : ERROR: ChrW(): undefined function.

Return ChrW(592)

~~~~~~~~~~~~~~~^

C:\Dokumente\Skript\AutoIT\fliptext.au3 - 1 error(s), 0 warning(s)

with latestest beta.

Br, Reinhard

Edited by ReFran
Link to comment
Share on other sites

Got:

C:\Dokumente\Skript\AutoIT\fliptext.au3(36,19) : ERROR: ChrW(): undefined function.

Return ChrW(592)

~~~~~~~~~~~~~~~^

C:\Dokumente\Skript\AutoIT\fliptext.au3 - 1 error(s), 0 warning(s)

with latestest beta.

Br, Reinhard

Are you by any chance using AutoIt3A.exe ?

Im using autoit version 3.2.4.9

Link to comment
Share on other sites

The helpfile say: v3.2.3.14 (beta)

API_FindExecutable("C:\Test.au3") say: C:\util\AutoIt3\beta\AutoIt3.exe

Br, Reinhard

PS: For what is ....A.exe

You must upgrade to latest version for this to work(3.2.4.9)

Autoit3A.exe is the ANSI version of autoit.

Edited by Creator
Link to comment
Share on other sites

Cool ;)

I am created a more advanced version with:

  • Flip
  • Un-Flip
  • Big Text Convert
  • One-Line text convert
  • And that would be all :lmao:
Here is the code:

(as always...autoit button won't work..:whistle:)

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Flip - Main", 450, 201, 193, 115)
$FlipBig = GUICtrlCreateButton("Flip Big Text", 8, 88, 211, 25, 0)
GUICtrlCreateLabel("Welcome to Flip!", 8, 8, 83, 17)
GUICtrlCreateLabel("Coding (most): Creator", 8, 32, 108, 17)
GUICtrlCreateLabel("GUI: i542", 8, 56, 49, 17)
$FlipLine = GUICtrlCreateButton("Flip One Line", 232, 88, 195, 25, 0)
$Quit = GUICtrlCreateButton("Exit", 8, 152, 211, 25, 0)
$GiveFeedback = GUICtrlCreateButton("Give Feedback", 232, 152, 195, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Flip/Un-Flip Big Text", 466, 255, 303, 219)
$BigInput = GUICtrlCreateEdit("", 8, 8, 201, 201, -1, $WS_EX_STATICEDGE)
GUICtrlCreateLabel("--->", 224, 88, 19, 17)
$BigOut = GUICtrlCreateEdit("", 256, 8, 185, 201, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_HSCROLL,$WS_VSCROLL), $WS_EX_STATICEDGE)
$BigFlip = GUICtrlCreateButton("Flip", 144, 224, 75, 25, 0)
$BigUnFlip = GUICtrlCreateButton("Un-Flip", 240, 224, 75, 25, 0)
#EndRegion ### END Koda GUI section ###


#Region ### START Koda GUI section ### Form=
$Form3 = GUICreate("Flip/Un-Flip Line", 466, 112, 303, 219, -1, 0)
$LineFlip = GUICtrlCreateButton("Flip", 136, 40, 75, 25, 0)
$LineUnFlip = GUICtrlCreateButton("Un-Flip", 216, 40, 75, 25, 0)
$LineIn = GUICtrlCreateInput("", 8, 8, 441, 21, -1, $WS_EX_STATICEDGE)
$LineOut = GUICtrlCreateInput("", 8, 72, 441, 21, $ES_READONLY, $WS_EX_STATICEDGE)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        ;GUI 'n' stuff =)
        Case $GUI_EVENT_CLOSE
            If WinGetHandle("") = $Form2 Then
                GuiSetState(@SW_HIDE,$Form2)
                GuiSetState(@SW_SHOW,$Form1)
            ElseIf WinGetHandle("") = $Form3 Then
                GuiSetState(@SW_HIDE,$Form3)
                GuiSetState(@SW_SHOW,$Form1)
            Else
                Exit
            EndIf
        Case $Quit
            Exit
        Case $FlipBig
            GUISetState(@SW_SHOW,$Form2)
            GuiSetState(@SW_HIDE,$Form1)
        Case $FlipLine
            GUISetState(@SW_SHOW,$Form3)
            GuiSetState(@SW_HIDE,$Form1)
        Case $BigFlip
            GUICtrlSetData($BigOut,flip(GuiCtrlRead($BigInput)))
        Case $BigUnFlip
            GUICtrlSetData($BigOut,unflip(GuiCtrlRead($BigInput)))
        Case $LineFlip
            GUICtrlSetData($LineOut,flip(GuiCtrlRead($LineIn)))
        Case $LineUnFlip
            GUICtrlSetData($LineOut,unflip(GuiCtrlRead($LineIn)))
        Case $GiveFeedback
            MsgBox(64,"Info","Will open your default browser to reply in topic ""Fun with Unicode"". Please make sure you are registered on AutoIt forums =).")
            ShellExecute("http://www.autoitscript.com/forum/index.php?act=post&do=reply_post&f=9&t=48858")
    EndSwitch
WEnd


#region Unflip Func
func unflip($tu)
    $result = unflipString(StringLower($tu))
    Return $result
EndFunc
func unflipString($aString)
    $last = StringLen($aString) 
    $result = ""
    for $i = $last to 1 Step -1
        $result = $result & unflipChar(StringMid($aString,$i,1))
    Next
    return $result
EndFunc
Func unflipChar($c)
    Switch $c
        Case ChrW(592)
            Return 'a'
        Case 'q'
            Return 'b'
        Case ChrW(596)
            Return 'c'
        Case 'p'
            Return 'd'
        Case ChrW(477)
            Return 'e'
        Case ChrW(607)
            Return 'f'
        Case 'b'
            Return 'g'
        Case ChrW(613)
            Return 'h'
        Case '!'
            Return 'i'
        Case ChrW(1592) ;hmm strange char ;hehehe, u right, creator
            Return 'j'
        Case ChrW(670)
            Return 'k'
        Case '1'
            Return 'l'
        Case ChrW(623)
            Return 'm'
        Case 'u'
            Return 'n'
        Case 'o'
            Return 'o'
        Case 'd'
            Return 'p'
        Case 'b'
            Return 'q'
        Case ChrW(633)
            Return 'r'
        Case 's'
            Return 's'
        Case ChrW(647)
            Return 't'
        Case 'n'
            Return 'u'
        Case ChrW(652)
            Return 'v'
        Case ChrW(653)
            Return 'w'
        Case 'x'
            Return 'x'
        Case ChrW(654)
            Return 'y'
        Case 'z'
            Return 'z'
        Case ']'
            Return '['
        Case '['
            Return ']'
        Case ')'
            Return '('
        Case '('
            Return ')'
        Case '}'
            Return '{'
        Case '{'
            Return '}'
        Case ChrW(191)
            Return '?'
        Case ChrW(161)
            Return '!'
        Case ','
            Return "'"
        Case "'"
            Return ','
    EndSwitch
    
    return $c
EndFunc
#endregion
#region Flip func
func flip($tf) 
    $result = flipString(StringLower($tf))
    Return $result
EndFunc

func flipString($aString) 
    $last = StringLen($aString) 
    $result = ""
    for $i = $last to 1 Step -1
        $result = $result & flipChar(StringMid($aString,$i,1))
    Next
    return $result
EndFunc

func flipChar($c) 
    Switch $c
        Case 'a'
            Return ChrW(592)
        Case 'b'
            Return 'q'
        Case 'c'
            Return ChrW(596)
        Case 'd'
            Return 'p'
        Case 'e'
            Return ChrW(477)
        Case 'f'
            Return ChrW(607)
        Case 'g'
            Return 'b'
        Case 'h'
            Return ChrW(613)
        Case 'i'
            Return '!'
        Case 'j'
            Return ChrW(1592) ;hmm strange char 
        Case 'k'
            Return ChrW(670)
        Case 'l'
            Return '1'
        Case 'm'
            Return ChrW(623)
        Case 'n'
            Return 'u'
        Case 'o'
            Return 'o'
        Case 'p'
            Return 'd'
        Case 'q'
            Return 'b'
        Case 'r'
            Return ChrW(633)
        Case 's'
            Return 's'
        Case 't'
            Return ChrW(647)
        Case 'u'
            Return 'n'
        Case 'v'
            Return ChrW(652)
        Case 'w'
            Return ChrW(653)
        Case 'x'
            Return 'x'
        Case 'y'
            Return ChrW(654)
        Case 'z'
            Return 'z'
        Case '['
            Return ']'
        Case ']'
            Return '['
        Case '('
            Return ')'
        Case ')'
            Return '('
        Case '{'
            Return '}'
        Case '}'
            Return '{'
        Case '?'
            Return ChrW(191)
        Case '!'
            Return ChrW(161)
        Case "'"
            Return ','
        Case ','
            Return "'"
    EndSwitch
    
    return $c
    
EndFunc
#endregion

Try it.

To test Un-Flip, click on Flip One Line and enter: (= ɯɐɹboɹd ɟo uo!sɹǝʌ ʎɯ bu!sn ǝɹɐ noʎ sɯǝǝs

To exit Flip One Line or Flip Big Text use X and the Main will re-appear =)

@Creator: How to flip a "." ???

I can do signature me.

Link to comment
Share on other sites

Cool :P

I am created a more advanced version with:

  • Flip
  • Un-Flip
  • Big Text Convert
  • One-Line text convert
  • And that would be all ;)
Here is the code:

(as always...autoit button won't work..:lmao:)

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Flip - Main", 450, 201, 193, 115)
$FlipBig = GUICtrlCreateButton("Flip Big Text", 8, 88, 211, 25, 0)
GUICtrlCreateLabel("Welcome to Flip!", 8, 8, 83, 17)
GUICtrlCreateLabel("Coding (most): Creator", 8, 32, 108, 17)
GUICtrlCreateLabel("GUI: i542", 8, 56, 49, 17)
$FlipLine = GUICtrlCreateButton("Flip One Line", 232, 88, 195, 25, 0)
$Quit = GUICtrlCreateButton("Exit", 8, 152, 211, 25, 0)
$GiveFeedback = GUICtrlCreateButton("Give Feedback", 232, 152, 195, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Flip/Un-Flip Big Text", 466, 255, 303, 219)
$BigInput = GUICtrlCreateEdit("", 8, 8, 201, 201, -1, $WS_EX_STATICEDGE)
GUICtrlCreateLabel("--->", 224, 88, 19, 17)
$BigOut = GUICtrlCreateEdit("", 256, 8, 185, 201, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_READONLY,$ES_WANTRETURN,$WS_HSCROLL,$WS_VSCROLL), $WS_EX_STATICEDGE)
$BigFlip = GUICtrlCreateButton("Flip", 144, 224, 75, 25, 0)
$BigUnFlip = GUICtrlCreateButton("Un-Flip", 240, 224, 75, 25, 0)
#EndRegion ### END Koda GUI section ###
#Region ### START Koda GUI section ### Form=
$Form3 = GUICreate("Flip/Un-Flip Line", 466, 112, 303, 219, -1, 0)
$LineFlip = GUICtrlCreateButton("Flip", 136, 40, 75, 25, 0)
$LineUnFlip = GUICtrlCreateButton("Un-Flip", 216, 40, 75, 25, 0)
$LineIn = GUICtrlCreateInput("", 8, 8, 441, 21, -1, $WS_EX_STATICEDGE)
$LineOut = GUICtrlCreateInput("", 8, 72, 441, 21, $ES_READONLY, $WS_EX_STATICEDGE)

#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        ;GUI 'n' stuff =)
        Case $GUI_EVENT_CLOSE
            If WinGetHandle("") = $Form2 Then
                GuiSetState(@SW_HIDE,$Form2)
                GuiSetState(@SW_SHOW,$Form1)
            ElseIf WinGetHandle("") = $Form3 Then
                GuiSetState(@SW_HIDE,$Form3)
                GuiSetState(@SW_SHOW,$Form1)
            Else
                Exit
            EndIf
        Case $Quit
            Exit
        Case $FlipBig
            GUISetState(@SW_SHOW,$Form2)
            GuiSetState(@SW_HIDE,$Form1)
        Case $FlipLine
            GUISetState(@SW_SHOW,$Form3)
            GuiSetState(@SW_HIDE,$Form1)
        Case $BigFlip
            GUICtrlSetData($BigOut,flip(GuiCtrlRead($BigInput)))
        Case $BigUnFlip
            GUICtrlSetData($BigOut,unflip(GuiCtrlRead($BigInput)))
        Case $LineFlip
            GUICtrlSetData($LineOut,flip(GuiCtrlRead($LineIn)))
        Case $LineUnFlip
            GUICtrlSetData($LineOut,unflip(GuiCtrlRead($LineIn)))
        Case $GiveFeedback
            MsgBox(64,"Info","Will open your default browser to reply in topic ""Fun with Unicode"". Please make sure you are registered on AutoIt forums =).")
            ShellExecute("http://www.autoitscript.com/forum/index.php?act=post&do=reply_post&f=9&t=48858")
    EndSwitch
WEnd
#region Unflip Func
func unflip($tu)
    $result = unflipString(StringLower($tu))
    Return $result
EndFunc
func unflipString($aString)
    $last = StringLen($aString) 
    $result = ""
    for $i = $last to 1 Step -1
        $result = $result & unflipChar(StringMid($aString,$i,1))
    Next
    return $result
EndFunc
Func unflipChar($c)
    Switch $c
        Case ChrW(592)
            Return 'a'
        Case 'q'
            Return 'b'
        Case ChrW(596)
            Return 'c'
        Case 'p'
            Return 'd'
        Case ChrW(477)
            Return 'e'
        Case ChrW(607)
            Return 'f'
        Case 'b'
            Return 'g'
        Case ChrW(613)
            Return 'h'
        Case '!'
            Return 'i'
        Case ChrW(1592) ;hmm strange char ;hehehe, u right, creator
            Return 'j'
        Case ChrW(670)
            Return 'k'
        Case '1'
            Return 'l'
        Case ChrW(623)
            Return 'm'
        Case 'u'
            Return 'n'
        Case 'o'
            Return 'o'
        Case 'd'
            Return 'p'
        Case 'b'
            Return 'q'
        Case ChrW(633)
            Return 'r'
        Case 's'
            Return 's'
        Case ChrW(647)
            Return 't'
        Case 'n'
            Return 'u'
        Case ChrW(652)
            Return 'v'
        Case ChrW(653)
            Return 'w'
        Case 'x'
            Return 'x'
        Case ChrW(654)
            Return 'y'
        Case 'z'
            Return 'z'
        Case ']'
            Return '['
        Case '['
            Return ']'
        Case ')'
            Return '('
        Case '('
            Return ')'
        Case '}'
            Return '{'
        Case '{'
            Return '}'
        Case ChrW(191)
            Return '?'
        Case ChrW(161)
            Return '!'
        Case ','
            Return "'"
        Case "'"
            Return ','
    EndSwitch
    
    return $c
EndFunc
#endregion
#region Flip func
func flip($tf) 
    $result = flipString(StringLower($tf))
    Return $result
EndFunc

func flipString($aString) 
    $last = StringLen($aString) 
    $result = ""
    for $i = $last to 1 Step -1
        $result = $result & flipChar(StringMid($aString,$i,1))
    Next
    return $result
EndFunc

func flipChar($c) 
    Switch $c
        Case 'a'
            Return ChrW(592)
        Case 'b'
            Return 'q'
        Case 'c'
            Return ChrW(596)
        Case 'd'
            Return 'p'
        Case 'e'
            Return ChrW(477)
        Case 'f'
            Return ChrW(607)
        Case 'g'
            Return 'b'
        Case 'h'
            Return ChrW(613)
        Case 'i'
            Return '!'
        Case 'j'
            Return ChrW(1592) ;hmm strange char 
        Case 'k'
            Return ChrW(670)
        Case 'l'
            Return '1'
        Case 'm'
            Return ChrW(623)
        Case 'n'
            Return 'u'
        Case 'o'
            Return 'o'
        Case 'p'
            Return 'd'
        Case 'q'
            Return 'b'
        Case 'r'
            Return ChrW(633)
        Case 's'
            Return 's'
        Case 't'
            Return ChrW(647)
        Case 'u'
            Return 'n'
        Case 'v'
            Return ChrW(652)
        Case 'w'
            Return ChrW(653)
        Case 'x'
            Return 'x'
        Case 'y'
            Return ChrW(654)
        Case 'z'
            Return 'z'
        Case '['
            Return ']'
        Case ']'
            Return '['
        Case '('
            Return ')'
        Case ')'
            Return '('
        Case '{'
            Return '}'
        Case '}'
            Return '{'
        Case '?'
            Return ChrW(191)
        Case '!'
            Return ChrW(161)
        Case "'"
            Return ','
        Case ','
            Return "'"
    EndSwitch
    
    return $c
    
EndFunc
#endregion

Try it.

To test Un-Flip, click on Flip One Line and enter: (= ɯɐɹboɹd ɟo uo!sɹǝʌ ʎɯ bu!sn ǝɹɐ noʎ sɯǝǝs

To exit Flip One Line or Flip Big Text use X and the Main will re-appear =)

@Creator: How to flip a "." ???

Nice job on making it more advanced! :P

Bout the flipping of '.' : i havent found a unicode char, which is a upside down '.' I dont believe it exists but i'm still searching actualy.. :whistle:

EDIT: Well its not exactly an upside down '.' but and circular '.' which i found while scanning http://unicode.org . For me it will do :lmao: Here it is: ChrW(176) (HEX:B0)

Edited by Creator
Link to comment
Share on other sites

Nice job on making it more advanced! :lmao:

Bout the flipping of '.' : i havent found a unicode char, which is a upside down '.' I dont believe it exists but i'm still searching actualy.. :whistle:

but with what program?

I can do signature me.

Link to comment
Share on other sites

but with what program?

Internet Explorer ghe ghe :whistle: look for small latin character set on http://unicode.org. Mostly the char is presented in HEX format. Use scientific calc to convert hex to dec and put the dec number in the ChrW function. For the '.' you can use ChrW(176) (its open but i dont mind)

Edited by Creator
Link to comment
Share on other sites

¡ʇ! pǝʞ!1 !

ʎuunɟ ʎɹǝʌ

:whistle:

Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator

VW Bug user

Pinheiral (Pinewood) city:

http://pt.wikipedia.org/wiki/Pinheiral

Link to comment
Share on other sites

In "real life" I do it with a pen and paper, using cursive write. I can write like in a mirror too.

It's an advantage of using left hand. :whistle:

Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator

VW Bug user

Pinheiral (Pinewood) city:

http://pt.wikipedia.org/wiki/Pinheiral

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...