summaryrefslogtreecommitdiff
path: root/2024/04/python
diff options
context:
space:
mode:
Diffstat (limited to '2024/04/python')
-rw-r--r--2024/04/python/main.py27
-rw-r--r--2024/04/python/pyproject.toml6
2 files changed, 0 insertions, 33 deletions
diff --git a/2024/04/python/main.py b/2024/04/python/main.py
deleted file mode 100644
index cc04f04..0000000
--- a/2024/04/python/main.py
+++ /dev/null
@@ -1,27 +0,0 @@
-from fileinput import input
-
-grid = {
- complex(idx, idy): c
- for idy, line in enumerate(input())
- for idx, c in enumerate(line.strip())
-}
-dirs = {complex(dx, dy) for dx in [-1, 0, 1] for dy in [-1, 0, 1]}
-
-
-def xmas(x, v):
- return all(grid.get(x + n * v) == c for n, c in enumerate("XMAS"))
-
-
-def x_mas(x, v):
- return (
- grid.get(x) == "A"
- and grid.get(x + v) == grid.get(x + 1j * v) == "M"
- and grid.get(x - v) == grid.get(x - 1j * v) == "S"
- )
-
-
-silver = sum(xmas(x, v) for x in grid.keys() for v in dirs)
-gold = sum(x_mas(x, v) for x in grid.keys() for v in dirs if abs(v) > 1)
-
-print("silver:", silver)
-print("gold:", gold)
diff --git a/2024/04/python/pyproject.toml b/2024/04/python/pyproject.toml
deleted file mode 100644
index 141044b..0000000
--- a/2024/04/python/pyproject.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[project]
-name = "aoc-2024-04"
-version = "0.1.0"
-description = "advent of code 2024-04"
-requires-python = ">=3.13"
-dependencies = []