Created
May 7, 2019 23:04
-
-
Save Blue587/5e0cc35621d0863241bcd974fea2ac3b 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
import sys | |
def convert(code): | |
converted = code.copy() | |
converted[2] = code[49] | |
converted[3] = code[12] | |
converted[4] = code[36] | |
converted[8] = code[26] | |
converted[12] = code[3] | |
converted[15] = code[59] | |
converted[19] = code[41] | |
converted[26] = code[8] | |
converted[29] = code[31] | |
converted[31] = code[29] | |
converted[36] = code[4] | |
converted[41] = code[19] | |
converted[49] = code[2] | |
converted[59] = code[15] | |
return converted | |
def print_code(code): | |
code_string = str() | |
for x in range(len(code)): | |
code_string += str(code[x]) | |
if x == 6 or x == 12 or x == 26 or x == 32 or x == 46 or x == 52 or x == 66 or x == 72: | |
code_string += " " | |
if x == 19 or x == 39 or x == 59: | |
code_string += "\n" | |
print(code_string) | |
print("Enter the password you want to convert to the other region. Use @ instead of the circle symbol.") | |
print("Press ctrl + D when you're done typing the password.") | |
print("It is not necessary to type the fourth line in this program because it is the same in both regions.\n") | |
print("Enter the password:") | |
code = list(sys.stdin.read()) | |
code = [x for x in code if x != ' ' and x != '\n'] # removes spaces and new lines | |
print("\nThe converted code is:") | |
print_code((convert(code))) | |
if len(code) == 60: | |
print("XXXXXXX XXXXXX XXXXXXX") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment