diff options
| author | hachem <im@hachem.wtf> | 2026-09-06 04:12:25 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-06 04:12:25 +0200 |
| commit | 054d372a716bca4f628674e524e3d027f6824019 (patch) | |
| tree | f1b8a86430476b4aed8173857bdab0f960e5fdb1 | |
| parent | 78c4d3d06d8e863cfe2489281ccfe206544cbd7f (diff) | |
refactor: clean up repository layout
| -rw-r--r-- | 2025/day1.asm (renamed from aoc-2025/day1.asm) | 0 | ||||
| -rw-r--r-- | 2025/day10.asm (renamed from aoc-2025/day10.asm) | 0 | ||||
| -rw-r--r-- | 2025/day11.asm (renamed from aoc-2025/day11.asm) | 0 | ||||
| -rw-r--r-- | 2025/day12.asm (renamed from aoc-2025/day12.asm) | 0 | ||||
| -rw-r--r-- | 2025/day2.asm (renamed from aoc-2025/day2.asm) | 0 | ||||
| -rw-r--r-- | 2025/day3.asm (renamed from aoc-2025/day3.asm) | 0 | ||||
| -rw-r--r-- | 2025/day4.asm (renamed from aoc-2025/day4.asm) | 0 | ||||
| -rw-r--r-- | 2025/day5.asm (renamed from aoc-2025/day5.asm) | 0 | ||||
| -rw-r--r-- | 2025/day6.asm (renamed from aoc-2025/day6.asm) | 0 | ||||
| -rw-r--r-- | 2025/day7.asm (renamed from aoc-2025/day7.asm) | 0 | ||||
| -rw-r--r-- | 2025/day8.asm (renamed from aoc-2025/day8.asm) | 0 | ||||
| -rw-r--r-- | 2025/day9.asm (renamed from aoc-2025/day9.asm) | 0 | ||||
| -rw-r--r-- | Dockerfile | 5 | ||||
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | README.md | 15 | ||||
| -rw-r--r-- | utils/io.asm (renamed from aoc-2025/utils/io.asm) | 0 | ||||
| -rw-r--r-- | utils/parse.asm (renamed from aoc-2025/utils/parse.asm) | 0 |
17 files changed, 15 insertions, 11 deletions
diff --git a/aoc-2025/day1.asm b/2025/day1.asm index 928e7a5..928e7a5 100644 --- a/aoc-2025/day1.asm +++ b/2025/day1.asm diff --git a/aoc-2025/day10.asm b/2025/day10.asm index 456752c..456752c 100644 --- a/aoc-2025/day10.asm +++ b/2025/day10.asm diff --git a/aoc-2025/day11.asm b/2025/day11.asm index c3cd930..c3cd930 100644 --- a/aoc-2025/day11.asm +++ b/2025/day11.asm diff --git a/aoc-2025/day12.asm b/2025/day12.asm index 8931a2b..8931a2b 100644 --- a/aoc-2025/day12.asm +++ b/2025/day12.asm diff --git a/aoc-2025/day2.asm b/2025/day2.asm index 987fbf9..987fbf9 100644 --- a/aoc-2025/day2.asm +++ b/2025/day2.asm diff --git a/aoc-2025/day3.asm b/2025/day3.asm index 8330755..8330755 100644 --- a/aoc-2025/day3.asm +++ b/2025/day3.asm diff --git a/aoc-2025/day4.asm b/2025/day4.asm index 60e53ec..60e53ec 100644 --- a/aoc-2025/day4.asm +++ b/2025/day4.asm diff --git a/aoc-2025/day5.asm b/2025/day5.asm index 4718343..4718343 100644 --- a/aoc-2025/day5.asm +++ b/2025/day5.asm diff --git a/aoc-2025/day6.asm b/2025/day6.asm index 728b8b0..728b8b0 100644 --- a/aoc-2025/day6.asm +++ b/2025/day6.asm diff --git a/aoc-2025/day7.asm b/2025/day7.asm index 1d990a7..1d990a7 100644 --- a/aoc-2025/day7.asm +++ b/2025/day7.asm diff --git a/aoc-2025/day8.asm b/2025/day8.asm index 6a4ecec..6a4ecec 100644 --- a/aoc-2025/day8.asm +++ b/2025/day8.asm diff --git a/aoc-2025/day9.asm b/2025/day9.asm index e5a7d0d..e5a7d0d 100644 --- a/aoc-2025/day9.asm +++ b/2025/day9.asm @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 debian:bookworm-slim +FROM debian:bookworm-slim RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -10,7 +10,8 @@ RUN apt-get update \ WORKDIR /app COPY Makefile ./ -COPY aoc-2025/ ./aoc-2025/ +COPY 2025/ ./2025/ +COPY utils/ ./utils/ COPY README.md LICENSE ./ COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh @@ -4,7 +4,7 @@ LD ?= ld YEAR ?= 2025 DAY ?= -SRC_DIR := aoc-$(YEAR) +SRC_DIR := $(YEAR) BUILD_DIR := build/aoc-$(YEAR) NASMFLAGS ?= -f elf64 @@ -13,7 +13,7 @@ LDFLAGS ?= -m elf_x86_64 DAYS := $(basename $(notdir $(wildcard $(SRC_DIR)/day*.asm))) BINARIES := $(addprefix $(BUILD_DIR)/,$(DAYS)) -UTILS := $(wildcard $(SRC_DIR)/utils/*.asm) +UTILS := $(wildcard utils/*.asm) .PHONY: all clean list run @@ -23,7 +23,7 @@ $(BUILD_DIR): @mkdir -p $@ $(BUILD_DIR)/%.o: $(SRC_DIR)/%.asm $(UTILS) | $(BUILD_DIR) - @$(NASM) $(NASMFLAGS) -I$(SRC_DIR)/ $< -o $@ + @$(NASM) $(NASMFLAGS) -I. $< -o $@ $(BUILD_DIR)/%: $(BUILD_DIR)/%.o @$(LD) $(LDFLAGS) -o $@ $< @@ -6,31 +6,34 @@ I don't particularly care about the AoC leaderboard. December is usually a prett AoC gives each user their own puzzle input. I keep my inputs locally and do not commit them to this repository. If you're running these solutions yourself, you'll need to provide your own inputs in whatever format the corresponding solution expects.
## Docker
-The solutions are Linux x64 ELF binaries, so they don't run natively on macOS or Windows. The image bundles `nasm`, `ld`, and `make`. It's pinned to `linux/amd64`; on Apple Silicon it runs under emulation automatically (you'll see a harmless platform-mismatch warning).
+The solutions are Linux x64 ELF binaries, so they don't run natively on macOS or Windows. The image bundles `nasm`, `ld`, and `make`.
+
+Since the solutions target x86-64, the container should be run as `linux/amd64`. On Apple Silicon, Docker will run it under emulation.
Build the image from the repository root:
```sh
-docker build -t aoc .
+docker build --platform=linux/amd64 -t aoc .
```
List the available days:
```sh
-docker run --rm aoc list
+docker run --platform=linux/amd64 --rm aoc list
```
-### Inputs
AoC inputs are per-user and are not committed to this repo. Put your input for a given day at `input/dayN.txt` in the repository root, then mount that directory when running so the solution can read it:
```sh
-docker run --rm -v "$PWD/input:/app/input" aoc day5
+docker run --platform=linux/amd64 --rm \
+ -v "$PWD/input:/app/input" \
+ aoc run DAY=5
```
Assemble and link every day without running it — a quick build check that needs no input:
```sh
-docker run --rm aoc all
+docker run --platform=linux/amd64 --rm aoc all
```
When you're done, remove the image with:
diff --git a/aoc-2025/utils/io.asm b/utils/io.asm index 2081671..2081671 100644 --- a/aoc-2025/utils/io.asm +++ b/utils/io.asm diff --git a/aoc-2025/utils/parse.asm b/utils/parse.asm index 833cb4e..833cb4e 100644 --- a/aoc-2025/utils/parse.asm +++ b/utils/parse.asm |
