Overview
Comment: | first check |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6802a94662c2b336dd44db0b3122c55d |
User & Date: | nnz on 2024-12-04 10:01:09 |
Other Links: | manifest | tags |
Context
2024-12-04
| ||
10:51 | 202404 1st star check-in: 0fa98a442c user: nnz tags: trunk | |
10:01 | first check check-in: 6802a94662 user: nnz tags: trunk | |
09:46 | added tcc check-in: 999b1250b6 user: nnz tags: trunk | |
Changes
Modified aoc2024.c from [69856484c5] to [9ff67230c6].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <ctype.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "aocdailies.h" #include "aocutils.h" void aoc202403(char *data, size_t len) { (void)len; // unused argument unsigned sumproducts = 0, sumproducts2 = 0, term[2]; char *rest = data; char *doleft = data; char *dorite = strstr(data + 1, "do()"); | > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include <ctype.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "aocdailies.h" #include "aocutils.h" void aoc202404(char *data, size_t len) { (void)len; // unused argument // assume data is well-formatted and has the same number of rows and columns unsigned cols = strchr(data, '\n') - data, rows = cols; printf("data has %u cols, first three rows start with %c%c, %c%c, and %c%c.\n", rows, data[0], data[1], data[1*(cols+1)], data[1*(cols+1)+1], data[2*(cols+1)], data[2*(cols+1)+1]); } void aoc202403(char *data, size_t len) { (void)len; // unused argument unsigned sumproducts = 0, sumproducts2 = 0, term[2]; char *rest = data; char *doleft = data; char *dorite = strstr(data + 1, "do()"); |
︙ | ︙ |
Modified aocdailies.c from [b62593c7a5] to [33016a1e3a].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #include <stddef.h> #include "aocdailies.h" aocfunc *aocselect(unsigned y, unsigned d) { aocfunc *p; switch (y * 100 + d) { default: p = NULL; break; case 202403: p = aoc202403; break; case 202402: p = aoc202402; break; case 202401: p = aoc202401; break; #if 0 case 201525: p = aoc201525; break; case 201524: p = aoc201524; break; | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #include <stddef.h> #include "aocdailies.h" aocfunc *aocselect(unsigned y, unsigned d) { aocfunc *p; switch (y * 100 + d) { default: p = NULL; break; case 202404: p = aoc202404; break; case 202403: p = aoc202403; break; case 202402: p = aoc202402; break; case 202401: p = aoc202401; break; #if 0 case 201525: p = aoc201525; break; case 201524: p = aoc201524; break; |
︙ | ︙ |
Modified aocdailies.h from [9b2b79b159] to [f7a4957d4e].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #ifndef AOCDAILIES_H_INCLUDED #define AOCDAILIES_H_INCLUDED #include <stddef.h> typedef void aocfunc(char *, size_t); aocfunc *aocselect(unsigned, unsigned); aocfunc aoc202403; aocfunc aoc202402; aocfunc aoc202401; #if 0 aocfunc aoc201525; aocfunc aoc201524; | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #ifndef AOCDAILIES_H_INCLUDED #define AOCDAILIES_H_INCLUDED #include <stddef.h> typedef void aocfunc(char *, size_t); aocfunc *aocselect(unsigned, unsigned); aocfunc aoc202404; aocfunc aoc202403; aocfunc aoc202402; aocfunc aoc202401; #if 0 aocfunc aoc201525; aocfunc aoc201524; |
︙ | ︙ |