This repository contains my solutions to the annual Advent of Code challenge, implemented in C.
.
├── 2024/
│ ├── aoc.h
│ ├── day01/
│ │ ├── day01.c
│ │ ├── Makefile
│ │ └── data/
│ │ ├── test.txt
│ │ └── input.txt
│ ├── day02/
│ │ └── ...
│ └── ...
├── ...
├── template/
│ ├── aoc.h
│ └── dayXX/
│ ├── dayXX.c
│ ├── Makefile
│ └── data/
│ ├── test.txt
│ └── input.txt
└── README.md
- Each year folder contains several
day<XX>directories. - Each day directory builds a single executable in the same folder.
- Each day has its own
data/directory containing:test.txt(example input from the AoC website)input.txt(your personal puzzle input)
- GCC / Clang / MSVC supporting C99
- Make
Each day solutions is an independent program with its own Makefile.
Move to the corresponding day directory :
cd <YEAR>/day<DAY_NUMBER>Build the solution :
make buildThe executable will automatically load its input from the local data/ directory.
You can build the solution to use the test input :
make testRun the executable :
make runClean generated files (executable, dependency) :
make cleanTo add another year:
- Create a new directory with the correct year
- Copy all contents from the
templatedirectory into the new directory - Edit the define
AOC_YEARin the header fileaoc.h - Rename the day directory and source file.
- Edit the define
AOC_DAYin the source file.
Raphael CAUSSE