diff options
author | Thomas Voss <thomasvoss@live.com> | 2021-12-02 10:05:22 +0100 |
---|---|---|
committer | Thomas Voss <thomasvoss@live.com> | 2021-12-02 10:05:22 +0100 |
commit | 8e6440d8fd69caedc11192dca02a6ae28f5248cf (patch) | |
tree | 3a99cb992870acbea9d887523f42378d9b1b28a2 /2015/18/puzzles.py | |
parent | 00b67942fed9961bd8d46d6f4fdae97dd074bb4e (diff) |
Improve the makeshift macros
Diffstat (limited to '2015/18/puzzles.py')
-rw-r--r-- | 2015/18/puzzles.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/2015/18/puzzles.py b/2015/18/puzzles.py index 5fbe572..4082ab5 100644 --- a/2015/18/puzzles.py +++ b/2015/18/puzzles.py @@ -28,10 +28,9 @@ def simulate(data: list[list[str]]) -> list[list[str]]: cond = lambda x, y: (data[x][y] == "#" and neighbours(data, x, y) in [2, 3]) or ( data[x][y] == "." and neighbours(data, x, y) == 3 ) - # END PART 1 - # START PART 2 + # END PART 1 START PART 2 cond = lambda x, y: ( - ((i, j) in [(0, 0), (0, 99), (99, 0), (99, 99)]) + ((x, y) in [(0, 0), (0, 99), (99, 0), (99, 99)]) or (data[x][y] == "#" and neighbours(data, x, y) in [2, 3]) or (data[x][y] == "." and neighbours(data, x, y) == 3) ) |