My program needs to fix an encrypted text file. The person who wrote it put it in “leet speak”, with special characters representing various letters. For example, consider the sample below:
1 4|-| 50 |_33+.
is really
I am so leet.
Here is the conversion table I need to use.
A 4
B 8
C [
D |)
E 3
F |#
G 6
H #
I 1
J ]
K |\
L |_
M |-|
N |\|
O 0
P |*
Q 0\
R 2
S 5
T +
U |_|
V \/
W \/\/
X ><
Y 7
Z 7_
Your program should read leet speak sentences from a file called "leet.txt" (one sentence per line). It should covert each sentence to normal English and print it to the screen.
here is what I have:
It is printing in leet but where do I put in the line to map it to the dictionary? And How do I move down?
1 4|-| 50 |_33+.
is really
I am so leet.
Here is the conversion table I need to use.
A 4
B 8
C [
D |)
E 3
F |#
G 6
H #
I 1
J ]
K |\
L |_
M |-|
N |\|
O 0
P |*
Q 0\
R 2
S 5
T +
U |_|
V \/
W \/\/
X ><
Y 7
Z 7_
Your program should read leet speak sentences from a file called "leet.txt" (one sentence per line). It should covert each sentence to normal English and print it to the screen.
here is what I have:
Code:
d= {"4":"A", "8":"B", "[":"C", "|)":"D", "3":"E", "|#":"F", "6":"G", "#":"H", "1":"I", "]":"J", "|\\":"K", "|_":"L", "|-|":"M", "|\\|":"N", "0":"O", "|*":"P", "0\\":"Q", "2":"R", "5":"S", "+":"T", "|_|":"U", "\\/":"V", "\\/\\/":"W", "><":"X", "7":"Y", "7_":"Z"}
infile = open("leet.txt", "r")
for line in infile:
line.split
window = 4
i = 0
while i < len(line):
t = line[i:i+window]
i += window
print (line)
Comment