diff options
author | Thomas Voss <mail@thomasvoss.com> | 2022-11-30 12:23:17 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2022-11-30 12:23:17 +0100 |
commit | f3e3e3e354b87f4ce27bd74bf14cec05d06974b6 (patch) | |
tree | 112352e9c3ba5d5d924036def2b5f853d3f8dc28 /2015/18 | |
parent | 4742dd73046c53cff7fe54deee58358c3b193206 (diff) |
Lots of cleanup and stuff
Diffstat (limited to '2015/18')
-rw-r--r-- | 2015/18/Makefile | 9 | ||||
-rw-r--r-- | 2015/18/puzzles.py | 10 |
2 files changed, 6 insertions, 13 deletions
diff --git a/2015/18/Makefile b/2015/18/Makefile index 247194a..0a4e980 100644 --- a/2015/18/Makefile +++ b/2015/18/Makefile @@ -1,8 +1 @@ -all: - sed '/START PART 2/,/END PART 2/d' puzzles.py >puzzle-1.py - sed '/START PART 1/,/END PART 1/d' puzzles.py >puzzle-2.py - chmod +x puzzle-[12].py - -.PHONY: clean -clean: - rm -f puzzle-[12].py +include ../../Makefiles/py.mk diff --git a/2015/18/puzzles.py b/2015/18/puzzles.py index 4082ab5..2aa03b9 100644 --- a/2015/18/puzzles.py +++ b/2015/18/puzzles.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 def neighbours(data: list[list[str]], x: int, y: int) -> int: @@ -6,12 +6,12 @@ def neighbours(data: list[list[str]], x: int, y: int) -> int: for x1, y1 in [ (x - 1, y - 1), - (x - 1, y), + (x - 1, y ), (x - 1, y + 1), - (x, y - 1), - (x, y + 1), + (x, y - 1), + (x, y + 1), (x + 1, y - 1), - (x + 1, y), + (x + 1, y ), (x + 1, y + 1), ]: try: |