aoc
my aoc solutions, written in x64 assembly. there is absolutely no good reason to pick assembly for this. i could have gone with c, c++, rust, or pretty much anything else, but where's the fun in that? i'm doing this because i was bored, needed a reason to procrastinate, and, in any case, i don't have that many excuses to write assembly these days anymore, so these let me stay up to spec. since assembly is beyond annoying to deal with between machines, i provide a dockerfile with all the tools you might need to build and run the solutions.
i don't particularly care about the aoc leaderboard. december is usually a pretty busy time for me, so i often don't have the time (or energy) to sit down and solve every puzzle on the day it comes out. as a result, some solutions may be uploaded days, weeks, or potentially much later than the actual puzzle release. that's intentional. i'm doing these primarily because i enjoy solving the problems and because they're a fun excuse to write increasingly questionable amounts of assembly. getting a good leaderboard position isn't really the point for me. if a solution appears suspiciously late, that's probably why.
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.
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:
docker build --platform=linux/amd64 -t aoc .
list the available days:
docker run --platform=linux/amd64 --rm aoc list
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:
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:
docker run --platform=linux/amd64 --rm aoc all
when you're done, remove the image with:
docker rmi aoc
license
mit, because if you actually want to use this code, you clearly need more help than permission.
