-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDIEUWKGF.py
75 lines (66 loc) · 1.33 KB
/
DIEUWKGF.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
71
72
73
74
75
def getNumOfCodes():
return len(Codes)
#trys to see if the letter is in the "code" if it isnt it returns the same letter
def getCode(code, char):
coded = Codes[code]
try:
return coded[char]
except:
return char
def getDecode(code, char):
decode = Codes[code]
for key, value in decode.items():
if char == value:
return key
return char
def getCodeType(list):
tell = list[-1]
for codes in Codes:
if codes[tell] == "tell":
return codes["code"]
print("no")
return 404
# this is the starter code. it will be referenced as index 0 in the codes array
# *Doesnt support caps but wanted to leave the freedom to create codes with capitalizations*
starter = {
"code": 0,
".": "tell",
"q": "m",
"w": "n",
"e": "b",
"r": "v",
"t": "c",
"y": "x",
"u": "z",
"i": "l",
"o": "k",
"p": "j",
"a": "h",
"s": "g",
"d": "f",
"f": "d",
"g": "s",
"h": "a",
"j": "p",
"k": "o",
"l": "i",
"z": "u",
"x": "y",
"c": "t",
"v": "r",
"b": "e",
"n": "w",
"m": "q",
"1": "7",
"2": "8",
"3": "9",
"4": "0",
"5": "1",
"6": "2",
"7": "3",
"8": "4",
"9": "5",
"0": "6"
}
# make sure o add any codes names into this array
Codes = [starter]