aboutsummaryrefslogtreecommitdiff
path: root/2025/04/b.py
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-12-04 10:38:46 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-12-04 10:38:46 +0100
commit10caeb18b9c224c8b42ca724e956dba35807ec2c (patch)
treef8ce59df5b4e654854e4d6d2d6fe428b75f16483 /2025/04/b.py
parentbc79fa83d3cb63d8445312b47dbed9295809b28a (diff)
downloadaoc-10caeb18b9c224c8b42ca724e956dba35807ec2c.tar.gz
aoc-10caeb18b9c224c8b42ca724e956dba35807ec2c.zip
Small cleanup
Diffstat (limited to '2025/04/b.py')
-rw-r--r--2025/04/b.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/2025/04/b.py b/2025/04/b.py
index 93b1fff..583c076 100644
--- a/2025/04/b.py
+++ b/2025/04/b.py
@@ -7,13 +7,14 @@ def neigh(a, i, j):
7 a[i+1][j-1], a[i+1][j], a[i+1][j+1], 7 a[i+1][j-1], a[i+1][j], a[i+1][j+1],
8 ].count('@') 8 ].count('@')
9 9
10s = 0
11with fileinput.input() as lines: 10with fileinput.input() as lines:
12 a = [['.'] * 200] 11 a = [
13 for line in lines: 12 ['.'] * 200,
14 a.append(['.'] + list(line.replace('\n', '.'))) 13 *[['.'] + list(line.replace('\n', '.')) for line in lines],
15 a.append(['.'] * 200) 14 ['.'] * 200,
15 ]
16 16
17s = 0
17rem = True 18rem = True
18while rem: 19while rem:
19 rem = False 20 rem = False

Generated with cgit - Back to sebastiano.tronto.net