File tree Expand file tree Collapse file tree 6 files changed +70
-12
lines changed
Expand file tree Collapse file tree 6 files changed +70
-12
lines changed Original file line number Diff line number Diff line change @@ -8,18 +8,29 @@ def main():
88
99
1010def first_step (input ):
11- im = Image .open (input )
12- print (im .size )
13- counter = 0
14- for frame in ImageSequence .Iterator (im ):
15- counter += 1
16- print (counter )
17- width = 640
18- height = 480
19- for x in range (width ):
20- for y in range (height ):
21- print (im .getpixel ((x , y )), end = " " )
22- print ()
11+ imgbase = Image .open ('ufo/mandelbrot.gif' )
12+ img = imgbase .copy ()
13+ left = 0.34
14+ top = 0.57 + 0.027
15+ width = 0.036
16+ height = 0.027
17+ max = 128
18+ diff = []
19+ for j in range (imgbase .size [1 ]):
20+ for i in range (imgbase .size [0 ]):
21+ point0 = complex (left + i * width / imgbase .size [0 ], top - (1 + j ) * height / imgbase .size [1 ])
22+ point = 0 + 0j
23+ for k in range (max ):
24+ point = point ** 2 + point0
25+ if point .imag ** 2 + point .real ** 2 > 4 :
26+ break
27+ img .putpixel ((i , j ), k )
28+ if k != imgbase .getpixel ((i , j )):
29+ diff .append (k - imgbase .getpixel ((i , j )))
30+ img .save ('ufo/out31.png' )
31+ img2 = Image .new ('1' , (23 , 73 ))
32+ img2 .putdata ([i < 0 for i in diff ])
33+ img2 .save ('ufo/out31_2.png' )
2334
2435
2536if __name__ == "__main__" :
Original file line number Diff line number Diff line change 1+ def main ():
2+ first_step ()
3+
4+
5+ def first_step ():
6+ pass
7+
8+
9+ if __name__ == "__main__" :
10+ main ()
Original file line number Diff line number Diff line change 11# pythonchallenge
22Solve Problems in http://www.pythonchallenge.com
33
4+ #### 32
5+ ##### use wget to download a file provider username and password
6+ 1 . user: password @domain url
7+ 1 . --user=${username} --password=${password}
8+ - wget http://kohsamui:thailand@www.pythonchallenge.com/pc/rock/warmup.txt
9+ - wget --user=kohsamui --password=thailand www.pythonchallenge.com/pc/rock/warmup.txt
10+
411#### 31
12+ result : http://www.pythonchallenge.com/pc/rock/arecibo.html
13+ - the picture lead to-> http://www.pythonchallenge.com/pc/rock/grandpa.html
514- use firefox visit the url get the hint: island: country
615- username: kohsamui password: thailand
716
Original file line number Diff line number Diff line change 1+ # Dimensions
2+ 9 9
3+
4+ # Horizontal
5+ 2 1 2
6+ 1 3 1
7+ 5
8+
9+ 7
10+ 9
11+ 3
12+
13+ 2 3 2
14+ 2 3 2
15+ 2 3 2
16+
17+ # Vertical
18+ 2 1 3
19+ 1 2 3
20+ 3
21+
22+ 8
23+ 9
24+ 8
25+
26+ 3
27+ 1 2 3
28+ 2 1 3
You can’t perform that action at this time.
0 commit comments