File tree Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Expand file tree Collapse file tree 2 files changed +40
-2
lines changed Original file line number Diff line number Diff line change
1
+ import zlib
2
+ import bz2
3
+
4
+
5
+ def main ():
6
+ first_step ()
7
+
8
+
9
+ def first_step ():
10
+ file = open ("game/package.pack" , "rb" )
11
+ bs = file .read ()
12
+ result = ""
13
+ while True :
14
+ if bs .startswith (b"x\x9c " ):
15
+ bs = zlib .decompress (bs )
16
+ result += " "
17
+ elif bs .startswith (b"BZ" ):
18
+ bs = bz2 .decompress (bs )
19
+ result += "#"
20
+ elif bs .endswith (b"\x9c x" ):
21
+ bs = bs [::- 1 ]
22
+ result += "\n "
23
+ else :
24
+ break
25
+ print (result )
26
+
27
+
28
+ if __name__ == "__main__" :
29
+ main ()
Original file line number Diff line number Diff line change 1
1
# pythonchallenge
2
2
Solve Problems in http://www.pythonchallenge.com
3
3
4
+ #### 21
5
+ result: http://www.pythonchallenge.com/pc/hex/copper.html
6
+ ``` python
7
+ import zlib
8
+ import bz2
9
+ ```
10
+ - Here is a [ List of file signatures] ( https://en.wikipedia.org/wiki/List_of_file_signatures )
11
+
12
+
4
13
#### 20
5
14
result: password is redavni
6
15
``` python
@@ -23,9 +32,9 @@ import base64
23
32
import wave
24
33
```
25
34
- use base64 to decode these codes
26
- - use wave to reand and write frame
35
+ - use wave to read and write frame
27
36
- the sea is yellow the land is blue,which is out of order
28
- - if you email to leopold with “sorry”, you will find a surprise
37
+ - if you email to leopold with “sorry” as subject , you will get a surprise
29
38
30
39
31
40
#### 18
You can’t perform that action at this time.
0 commit comments