Created
October 15, 2017 13:09
-
-
Save gammy/2fbfe56c535cf3d3ac1605ca64344812 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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