Skip to content

Commit a4bc2b0

Browse files
committedNov 19, 2020
Remove useless parentheses
1 parent d1a73a7 commit a4bc2b0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎src/24-ambiguity.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
turns_set = {(1, 0), (0, 1), (-1, 0), (0, -1)}
2828

2929
turns_map = {
30-
(1, 0): turns_set - {((-1, 0))},
31-
(-1, 0): turns_set - {((1, 0))},
32-
(0, 1): turns_set - {((0, -1))},
33-
(0, -1): turns_set - {((0, 1))},
30+
(1, 0): turns_set - {(-1, 0)},
31+
(-1, 0): turns_set - {(1, 0)},
32+
(0, 1): turns_set - {(0, -1)},
33+
(0, -1): turns_set - {(0, 1)},
3434
}
3535

3636

‎src/etc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def image_to_text(image, threshold=10, skip=6, white="##", black=" "):
2828
image = image.crop(image.getbbox()).convert("L")
2929
cols, rows = -(-image.width // skip), -(-image.height // skip) # ceiling
3030
lines = [[black] * cols for _ in range(rows)]
31-
for (x, y) in product(range(0, image.width, skip), range(0, image.height, skip)):
31+
for x, y in product(range(0, image.width, skip), range(0, image.height, skip)):
3232
if image.getpixel((x, y)) > threshold:
3333
lines[y // skip][x // skip] = white
3434
return "\n".join(filter(str.strip, map("".join, lines)))

0 commit comments

Comments
 (0)
Please sign in to comment.