summaryrefslogtreecommitdiff
path: root/2024/16/python
diff options
context:
space:
mode:
Diffstat (limited to '2024/16/python')
-rw-r--r--2024/16/python/main.py29
-rw-r--r--2024/16/python/pyproject.toml6
2 files changed, 0 insertions, 35 deletions
diff --git a/2024/16/python/main.py b/2024/16/python/main.py
deleted file mode 100644
index f66fe94..0000000
--- a/2024/16/python/main.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from fileinput import input
-
-grid = {
- complex(idx, idy): c
- for idy, line in enumerate(input())
- for idx, c in enumerate(line.strip())
-}
-start = next(p for p, c in grid.items() if c == "S")
-end = next(p for p, c in grid.items() if c == "E")
-
-q = [(0, (start, 1))]
-seen = set()
-while q:
- curr = min(q, key=lambda x: x[0])
- d, (pos, vel) = curr
- q.remove(curr)
- if (pos, vel) in seen:
- continue
- if pos == end:
- silver = d
- break
- seen.add((pos, vel))
-
- if grid[pos + vel] != "#":
- q.append((d + 1, (pos + vel, vel)))
- q.append((d + 1000, (pos, vel * 1j)))
- q.append((d + 1000, (pos, vel * -1j)))
-
-print("silver:", silver)
diff --git a/2024/16/python/pyproject.toml b/2024/16/python/pyproject.toml
deleted file mode 100644
index d38516f..0000000
--- a/2024/16/python/pyproject.toml
+++ /dev/null
@@ -1,6 +0,0 @@
-[project]
-name = "aoc-2024-16"
-version = "0.1.0"
-description = "advent of code 2024-16"
-requires-python = ">=3.13"
-dependencies = []