Skip to content

Instantly share code, notes, and snippets.

@twirrim
Created July 9, 2021 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twirrim/adeb5b0a5aeb254f89519040148e0f9f to your computer and use it in GitHub Desktop.
Save twirrim/adeb5b0a5aeb254f89519040148e0f9f to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
flipdict = {
'a': 'ɐ',
'b': 'q',
'c': 'ɔ',
'C': 'Ɔ',
'd': 'p',
'e': 'ǝ',
'E': 'Ǝ',
'f': 'ɟ',
'g': 'ƃ',
'h': 'ɥ',
'i': 'ı',
'j': 'ɾ',
'k': 'ʞ',
'l': '⌉',
'm': 'ɯ',
'n': 'u',
'o': 'o',
'p': 'd',
'q': 'b',
'r': 'ɹ',
's': 's',
'S': 'S',
't': 'ʇ',
'u': 'n',
'v': 'ʌ',
'V': 'Λ',
'w': 'ʍ',
'x': 'x',
'y': 'ʎ',
'.': '˙',
'[': ']',
'(': ')',
'{': '}',
'?': '¿',
'!': '¡',
"'": ',',
'<': '>',
'_': '‾',
';': '؛',
'‿': '⁀',
'⁅': '⁆',
'∴': '∵', }
def flip_letter(letter):
if letter in flipdict:
return flipdict[letter]
return letter
def fliptext(text):
text = text[::-1]
flipped = ''.join(map(flip_letter, text))
output = "(╯°□°)╯︵ ┻━ {} ━┻".format(flipped)
print(output)
if __name__ == '__main__':
fliptext(sys.argv[1])
@twirrim
Copy link
Author

twirrim commented Oct 26, 2023

I have this on my box as "iflip" and in my $PATH, so I can do:

$ iflip "something stupid"
(╯°□°)╯︵ ┻━ pıdnʇs ƃuıɥʇǝɯos ━┻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment