Skip to content

Files

Latest commit

author
Christian Lundh
Feb 3, 2025
3825bf3 · Feb 3, 2025

History

History
142 lines (116 loc) · 6.55 KB

README.md

File metadata and controls

142 lines (116 loc) · 6.55 KB

Advent of Code in C

CMake

Testing all solutions on Linux, FreeBSD, OpenBSD and Windows/MinGW64. Target is to make the code platform independent which has turned out to be pretty difficult sometimes.

Possible to build using CMake. Builds with pre-defined custom targets for each day. To build run cmake -B build .

To run a specific day, for example Day 1 2021 run:

cd build
make run_2021_01

Or to run a specific year, for example 2021, run:

cd build
make run_2021

Replace make above with whatever build system you choose to use in CMake

2024 (Year of the plain C)

Day Stars Timing Part 1 Timing Part 2 Comment
1 ⭐⭐ Pretty fun
2 ⭐⭐ Probably not the most efficient...
3 ⭐⭐ Plain C almost. Using regex
4 ⭐⭐ Simpler solution but not faster
5 ⭐⭐ Messy.
6 ⭐⭐
12 Loop mania.
13 ⭐⭐ Simple, yet nice
14 ⭐⭐ Pretty nice

2023

Day Stars Timing Part 1 Timing Part 2
1 ⭐⭐
2 ⭐⭐
3 ⭐⭐
4 ⭐⭐
6 ⭐⭐
:---: :----------------- --------------: --------------:

2022

Day Stars Timing Part 1 Timing Part 2
1 ⭐⭐ 0.029 ms 0.009 ms
2 ⭐⭐ 0.004 ms 0.027 ms
3 ⭐⭐
4 ⭐⭐
5
6 ⭐⭐ 0.371 ms 0.678 ms
12 &#11088

2021

Day Stars Timing Part 1 Timing Part 2
1 ⭐⭐ 0.029 ms 0.009 ms
2 ⭐⭐
3 ⭐⭐
4 ⭐⭐
5 ⭐⭐
6 ⭐⭐
7 ⭐⭐
8 ⭐⭐
10 ⭐⭐
18 ⭐⭐

2020

Day Stars Timing Part 1 Timing Part 2 Comment
1 ⭐⭐
2 ⭐⭐
3 ⭐⭐
4 ⭐⭐
5 ⭐⭐
6 ⭐⭐
7 ⭐⭐
8 ⭐⭐
9 ⭐⭐
10 ⭐⭐
11 ⭐⭐
12 ⭐⭐
13 ⭐⭐
14 ⭐⭐
15 ⭐⭐
16 ⭐⭐
17 ⭐⭐

2019

Day Stars Timing Part 1 Timing Part 2
1 ⭐⭐ 0.029 ms 0.009 ms
2 ⭐⭐ 0.004 ms 0.027 ms
3 ⭐⭐ 0.881 ms 0.545 s
4 ⭐⭐ 0.016 s 0.016 s
5 ⭐⭐
6 ⭐⭐

2017:

Day Stars Timing Part 1 Timing Part 2 Comment
1 ⭐⭐
2 ⭐⭐
3 ⭐⭐ 0.266 ms 0.035 ms

2016

Day Stars Timing Part 1 Timing Part 2
1 ⭐⭐
2 ⭐⭐
3 ⭐⭐
5 ⭐⭐
6 ⭐⭐
7 ⭐⭐
8 ⭐⭐

2015

Day Stars Timing Part 1 Timing Part 2
1 ⭐⭐ 0.030 ms 0.009 ms
2 ⭐⭐
3 ⭐⭐
4 ⭐⭐
5 ⭐⭐
6 ⭐⭐
11 ⭐⭐