When I saw this title in the Hot Network Questions I thought it was going to be a PPCG challenge. I was a little disappointed when it was on Mathematica.

So now it is on PPCG:


Given an input string, output the ROT13, flipped value. The input will contain characters from the following alphabet: [abcdefghijklmnopqrstuvwxyz <flipped alphabet>]1

The flipped alphabet can be anything visually similar to the flipped lowercase Latin alphabet so long as it can be accepted as input.

The space character should remain unchanged.

As an example, your flipped alphabet might be zʎxʍʌnʇsɹbdouɯlʞɾᴉɥƃɟǝpɔqɐ


Input:    caesar woz ere
Rot13:    pnrfne jbm rer
Output:   ɹǝɹ ɯqɾ ǝuɟɹud

Input:    ɹǝɹ ɯqɾ ǝuɟɹud
Rot13:    pnrfne jbm rer
Output:   caesar woz ere


Simple , the lowest number of bytes wins.

I think this is different enough to the proposed duplicate for a few reasons:

  • The answerer has the choice of which characters to use as output (within limits)
  • The process should be reversible. i.e. flipped text should be acceptable as input and return "normal" text.
  • There is the opportunity for graphical solutions in this question.
  • 3
    \$\begingroup\$ Please include a list of the flipped alphabet. \$\endgroup\$
    – Leaky Nun
    Jun 8, 2017 at 9:38
  • \$\begingroup\$ related \$\endgroup\$
    – Leaky Nun
    Jun 8, 2017 at 9:40
  • \$\begingroup\$ @EriktheOutgolfer, I think it's probably different enough for a few reasons. I've added my reasons to the question. \$\endgroup\$ Jun 8, 2017 at 10:24
  • \$\begingroup\$ @JamesWebster Then, first of all, what are the limits? Second, what do you mean by "graphical solutions"? If the output is an image, are the solutions below supposed to take that image as input and print the original text or something? \$\endgroup\$ Jun 8, 2017 at 10:28
  • 6
    \$\begingroup\$ Your flipped alphabet contains letters from the roman alphabet, so it's impossible to know whether d is a flipped p and should therefore rot13 to ɔ before flipping to c, rather than rot13 to q and flipping to b. \$\endgroup\$
    – Neil
    Jun 8, 2017 at 10:44

2 Answers 2


Mathematica, 234 bytes


Python 3, 120 bytes

many bytes saved thanks to @JonathanAllan

lambda s,a='abcdefghijklmnopqrstuvwxyz VOďƄɹ5ʇη^MXʎ2ɐʠ>Pəɟ6ɥ!ɾʞ|W ':''.join(a[(a.find(c)+27)%54]for c in s)

Try it online!

  • \$\begingroup\$ @JonathanAllan fixed (plus space issue). in case of ambiguity (like "uodb") will choose the normal alphabet to translate from \$\endgroup\$
    – Uriel
    Jun 9, 2017 at 3:34
  • \$\begingroup\$ Nice fix, although the [abc... <flipped>] does suggest one alphabet and possible mixed input, maybe you can save bytes and fix both at the same time by picking some other unicode chars? \$\endgroup\$ Jun 9, 2017 at 3:43
  • \$\begingroup\$ @JonathanAllan I already tested the option to use a single string (with a[(a.index(x)+27)%54], but I didn't find decent replacements for the overlapping characters. \$\endgroup\$
    – Uriel
    Jun 9, 2017 at 3:47
  • \$\begingroup\$ @JonathanAllan I can't see dennis' tio links (wifi provider blocks) \$\endgroup\$
    – Uriel
    Jun 9, 2017 at 4:03
  • \$\begingroup\$ Wow, why? OK lambda s,a='abcdefghijklmnopqrstuvwxyz υοďƄɹ5ʇηʌʍXʎ2ɐʠɔǷəɟɓɥ!ɾʞ|ɯ ':''.join(a[(a.find(c)+27)%54]for c in s) \$\endgroup\$ Jun 9, 2017 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.