diff options
Diffstat (limited to 'src/2022/day25/aoc.h')
-rw-r--r-- | src/2022/day25/aoc.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/2022/day25/aoc.h b/src/2022/day25/aoc.h index ab55efd..e24291a 100644 --- a/src/2022/day25/aoc.h +++ b/src/2022/day25/aoc.h @@ -1,7 +1,25 @@ #include "common.h" +#include "stdint.h" #include <vector> namespace aoc2022 { -std::pair<int, int> day25(line_view); -} +struct snafu { + char* digits = nullptr; + size_t length = 0; + + void print() const noexcept { + for (size_t i = 0; i < length; i++) { + printf("%c", *(digits + i)); + } + } + + snafu(line_view lv) { + length = lv.length - 1; + digits = (char*)malloc(length); + memcpy(digits, lv.line, length); + } +}; + +std::pair<int64_t, int64_t> day25(line_view); +} // namespace aoc2022 |