Skip to content

Instantly share code, notes, and snippets.

@gammy
Created October 15, 2017 13:09
Show Gist options
  • Save gammy/2fbfe56c535cf3d3ac1605ca64344812 to your computer and use it in GitHub Desktop.
Save gammy/2fbfe56c535cf3d3ac1605ca64344812 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from __future__ import print_function
import sys
try:
input = sys.argv[1]
if not input:
print("No!", file=sys.stderr)
sys.exit(1)
except:
print("Usage: " + sys.argv[0] + " <string>", file=sys.stderr)
sys.exit(1)
print("In: " + input)
output = []
for c in list(input):
magic = ord(c) ^ 42
print(ord(c), chr(ord(c)), magic, chr(magic))
output.append(chr(magic))
print(''.join(output))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment