This is my attempt at improving the boline library, by solving the aoc 2022 challenges. The goal is to learn what features are missing and to implement these features. Moreover, this can function as sample code, and it's in general also a personal challenge.
Because we sadly can't parse raw files using the preprocessor, we'll be using a script to convert each days input into a comma separated list of hexadecimal bytes:
inputs/N.txt | inputs/N.c |
Hello World |
#define INPUT 48,65,6c,6c,6f,20,57,6f,72,6c,64,0a |
The output should require as few postprocessing as possible/practical.
So an expected output of 0.6
could be output as 3/5
and still count as a valid solution.
file | complexity | loc | runtime | added features | postprocessing | godbolt |
---|---|---|---|---|---|---|
aoc1.c | 2/10 | 28 | 2.1 sec | B<n>_MUL_B4 |
none | WK4zdW5vK |
aoc2.c | 1/10 | 31 | 2.8 sec | none | cKef7jPWs | |
aoc3.c | 9/10 | 64 | 9.2 sec | B<n>_FROM_Bn |
none | ezozv1jTT |
aoc4.c | 3/10 | 35 | 1.0 sec | none | 8TP8zeeb1 | |
aoc5.c | 4/10 | 71 | 2.1 sec | none | M1bedjhEv | |
aoc6.c | 2/10 | 26 | 4.9 sec | M<n>_PUT/_AT |
none | 7694fsWe9 |
aoc7.c | 6/10 | 53 | 11.7 sec | none | ohjdhE378 |
-
complexity: My personal rating of how complex the implementation was.
-
loc: The lines of code, may not correlate with my perceived complexity, as creating lookup tables is very easy, but adds a lot of lines.
-
runtime: Runtime on my PC with
tcc -P -E
. The runtime only partially reflect the performance of boline, since the inputs we are working with are raw bytes, which you wouldn't use in usual boline applications.