-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
70 lines (66 loc) · 1.24 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#goofy ahh message translater and encoder for minecraft
code = {
'A': 'e',
'B': 'm',
'C': 'n',
'D': 'o',
'E': 'u',
'F': 'q',
'G': 'r',
'H': 's',
'I': 'p',
'J': 't',
'K': 'v',
'L': 'w',
'M': 'x',
'N': 'y',
'O': 'g',
'P': 'a',
'Q': 'd',
'R': 'z',
'S': 'b',
'T': 'l',
'U': 'f',
'V': 'c',
'W': 'j',
'X': 'i',
'Y': 'h',
'Z': 'k',
' ': ' ',
'0': '@',
'1': ')',
'2': ':',
'3': '?',
'4': '=',
'5': '+',
'6': '%',
'7': '/',
'8': ',',
'9': '&',
'&': '.-...',
"'": '.----.',
'@': '.--.-.',
')': '-.--.-',
'(': '-.--.',
'': '---...',
',': '--..--',
'=': '-...-',
'!': '-.-.--',
'.': '.-.-.-',
'-': '-....-',
'+': '.-.-.',
'"': '.-..-.',
'?': '..--..',
'/': '-..-.'
}
mode = input("Translate or Encode:\n").lower()
message = input('Enter what you would like to translate/encode:\n')
if mode == "encode":
for i in range(len(message)):
print(code[message[i].upper()], end=' ')
if mode == "translate":
print('The translated message is:\n')
for i in range(len(message)):
for key, value in code.items():
if value == message[i]:
print(key, end=" ")