hachem.wtf
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-06 04:12:25 +0200
committerhachem <im@hachem.wtf>2026-09-06 04:12:25 +0200
commit054d372a716bca4f628674e524e3d027f6824019 (patch)
treef1b8a86430476b4aed8173857bdab0f960e5fdb1
parent78c4d3d06d8e863cfe2489281ccfe206544cbd7f (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--Dockerfile5
-rw-r--r--Makefile6
-rw-r--r--README.md15
-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
diff --git a/Dockerfile b/Dockerfile
index c45aa6c..7433372 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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
diff --git a/Makefile b/Makefile
index 5da61f2..c98ea0f 100644
--- a/Makefile
+++ b/Makefile
@@ -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 $@ $<
diff --git a/README.md b/README.md
index afa8008..5473379 100644
--- a/README.md
+++ b/README.md
@@ -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