[SOLVED] Translate C to AHK

Get help with using AutoHotkey and its commands and hotkeys
User avatar
jNizM
Posts: 2435
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

[SOLVED] Translate C to AHK

07 Mar 2014, 04:16

how to translate this short as possible?

Code: Select all

main(a)
{
    while(a=~getchar())
        putchar(~a-1/(~(a|32)/13*2-11)*13);
}
thanks for any help
Last edited by jNizM on 11 Mar 2014, 01:32, edited 1 time in total.
[AHK] 1.1.30.03 x64 Unicode | [WIN] 10 Pro (Version 1903) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
LinearSpoon
Posts: 156
Joined: 29 Sep 2013, 22:55

Re: Translate C to AHK

07 Mar 2014, 21:56

That C code doesn't actually compile (no include files, compiler may complain about lack of types), but I believe I understand the point of it - to be a ROT13 translator.

Code: Select all

Gui, Add, Edit, w300 h100 vInput gUpdate, Type your input here
Gui, Add, Edit, w300 h100 vOutput +ReadOnly
Gui, Show
GuiControl, Focus, Input

Update:
  Gui, Submit, NoHide
  Output := ""
  Loop, Parse, Input
  {
    a := ~Asc(A_LoopField)
    Output .= Chr(~a-1//(~(a|32)//13*2-11)*13)
  }
  GuiControl,,Output,%Output%
return

GuiClose:
  ExitApp
return
Last edited by LinearSpoon on 10 Mar 2014, 13:14, edited 1 time in total.
User avatar
jNizM
Posts: 2435
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: Translate C to AHK

10 Mar 2014, 06:13

Thank you...
Yes, I found this under The Worlds Shortest C Implementation of Rot13
[AHK] 1.1.30.03 x64 Unicode | [WIN] 10 Pro (Version 1903) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
joedf
Posts: 7131
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: Translate C to AHK

10 Mar 2014, 16:18

Wow.... That is short!
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 16GB DDR4 2733 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]
User avatar
joedf
Posts: 7131
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada
Contact:

Re: [SOLVED] Translate C to AHK

14 Mar 2014, 11:36

Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500 @ 4.00 GHz, 16GB DDR4 2733 MHz, NVIDIA GTX 1060 6GB | [About Me] | [ASPDM - StdLib Distribution]
[Populate the AHK MiniCity!] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library] | [About the AHK Foundation]

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Dumitas, TAC109, teadrinker and 231 guests