Skip to content

Commit 33697d8

Browse files
go on
1 parent 1146a94 commit 33697d8

File tree

6 files changed

+70
-12
lines changed

6 files changed

+70
-12
lines changed

31.py

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,29 @@ def main():
88

99

1010
def 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

2536
if __name__ == "__main__":

32.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def main():
2+
first_step()
3+
4+
5+
def first_step():
6+
pass
7+
8+
9+
if __name__ == "__main__":
10+
main()

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# pythonchallenge
22
Solve 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

ufo/out31.png

73.2 KB
Loading

ufo/out31_2.png

282 Bytes
Loading

warmup/warmup.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy