Skip to content

Commit 7b527b4

Browse files
try to solve 14
1 parent f6e431a commit 7b527b4

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

14.py

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from PIL import ImageDraw
33

44
im = Image.open("wire/wire.png")
5-
result = Image.new("RGB", (400, 50), "white")
5+
result = Image.new("RGB", (100, 100), "white")
66
drawer = ImageDraw.Draw(result)
77

88
im_size = im.size
@@ -16,29 +16,13 @@
1616
count = 0
1717
x = 0
1818
y = 0
19-
flag = 1
20-
len = 100
2119
while y < result_y:
22-
while x < len:
23-
drawer.point((x, y), im.getpixel((count, 0)))
24-
print("y is {}, x is {}, count is {}".format(y, x, count))
20+
while x < result_x:
21+
# print("count is {}, im.getpixel((count,0)) is{}".format(count,im.getpixel((count, 0))))
22+
drawer.point((x, y), im.getpixel((count,0)))
2523
x += 1
2624
count += 1
27-
if flag %4 == 0:
28-
y += 1
29-
x = 0
30-
if flag % 2 == 1:
31-
len -= 1
32-
flag += 1
25+
y += 1
26+
x = 0
3327

34-
result.show()
35-
36-
"""
37-
1 100
38-
2 99
39-
3 99
40-
4 98
41-
42-
5 98
43-
6 97
44-
"""
28+
result.show()

0 commit comments

Comments
 (0)