This commit is contained in:
2025-12-08 16:02:36 -06:00
parent d6f3266154
commit 2994837ebc
3 changed files with 225 additions and 15 deletions

23
day0.h
View File

@@ -12,27 +12,36 @@ ch test[] = {
#embed "day0_test.txt"
};
alignas(0x40) static
struct {
line padstart[4];
struct { ch *s; num _extra[7]; };
union { line l; struct { ch s[16]; num n; }; } result;
line padend;
} m;
static_assert(offsetof(typeof(m),result) % 64 == 0);
static_assert(offsetof(typeof(m),padend) % 64 == 0);
static
num do_part1(size_t file_len, ch file[file_len]) {
ch *s = file;
num result = 0;
m = (typeof(m)){ };
m.s = file;
m.result.n = 0;
#if DBG
print("\n");
#endif
do {
s++;
} while (s != &file[file_len]);
m.s++;
} while (m.s != &file[file_len]);
return result;
return m.result.n;
}
static
num do_part2(size_t file_len, ch file[file_len]) {
num result = 0;
return result;
return 0;
}
#define RUN_TEST1 1