-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencode.py
More file actions
39 lines (33 loc) · 773 Bytes
/
encode.py
File metadata and controls
39 lines (33 loc) · 773 Bytes
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
#
#%00
#%25 %30 %30
#%25 %32 %35 %25 %33 %30 %25 %33 %30
#↓↓↓
#%25 %32 %35 %25 %33 %30 %25 %33 %30
#%25 %32 %35 %25 %33 %32 %25 %33 %35 %25 %32 %35 %25 %33 %33 %25 %33 %30 %25 %32 %35 %25 %33 %33 %25 %33 %32
#Recursive encoding
import sys
A = int(sys.argv[1])
B = "%00"
print(B)
C = B
D = 0
E = ""
while ( D <= A ):
for letter in C:
if letter == "%":
E += "%25"
if letter == "0":
E += "%30"
if letter == "2":
E += "%32"
if letter == "3":
E += "%33"
if letter == "5":
E += "%35"
D += 1
C = E
print(C)
E = ""
with open("encoded.txt", "w") as f:
f.write(C)