Index: aoc.c ================================================================== --- aoc.c +++ aoc.c @@ -5,11 +5,11 @@ #include #include #include "aocdailies.h" // prototypes for all aocYYYYdd functions! #include "aocutils.h" -#define MAX_YEAR 2024 +#define MAX_YEAR 2025 int main(int argc, char **argv) { unsigned y = 0, d = 0; char dataname[99]; if (argc >= 3) { Index: aocdailies.c ================================================================== --- aocdailies.c +++ aocdailies.c @@ -3,10 +3,14 @@ aocfunc *aocselect(unsigned y, unsigned d) { aocfunc *p; switch (y * 100 + d) { default: p = NULL; break; + + case 202503: p = aoc202503; break; + case 202502: p = aoc202502; break; + case 202501: p = aoc202501; break; // YYYYdd ==> aocYYYYdd case 202422: p = aoc202422; break; case 202417: p = aoc202417; break; case 202409: p = aoc202409; break; Index: aocdailies.h ================================================================== --- aocdailies.h +++ aocdailies.h @@ -3,10 +3,14 @@ #include typedef void aocfunc(char *, size_t); aocfunc *aocselect(unsigned, unsigned); + +aocfunc aoc202503; +aocfunc aoc202502; +aocfunc aoc202501; aocfunc aoc202422; aocfunc aoc202417; aocfunc aoc202409; aocfunc aoc202408; Index: aocutils.c ================================================================== --- aocutils.c +++ aocutils.c @@ -33,10 +33,16 @@ tmp += F(b, c, d); tmp += k; tmp += t; *a = b + rotateleft(tmp, s); } + +long long unsigned upow(unsigned base, unsigned exponent) { + long long unsigned result = 1; + while (exponent--) result *= base; + return result; +} void md5mini(unsigned char *dstarr, const char *src) { // see https://www.ietf.org/rfc/rfc1321.txt static uint32_t T[64] = {0}; if (T[0] == 0) { Index: aocutils.h ================================================================== --- aocutils.h +++ aocutils.h @@ -5,10 +5,12 @@ struct TextGrid { unsigned cols, rows; char *data; // may have '\n' at end of rows }; + +long long unsigned upow(unsigned base, unsigned exponent); void md5mini(unsigned char *dstarr, const char *src); bool TGvalid(struct TextGrid *tg, unsigned col, unsigned row); char *TGcharptr(struct TextGrid *tg, unsigned col, unsigned row);