Overview
Comment: | 201505 1st star |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
93e9164929f2f73bde391af381236433 |
User & Date: | nnz on 2024-12-15 11:44:22 |
Original Comment: | 201504 1st star |
Other Links: | manifest | tags |
Context
2024-12-15
| ||
12:24 | 201505 2nd star check-in: c2af59b62e user: nnz tags: trunk | |
11:44 | 201505 1st star check-in: 93e9164929 user: nnz tags: trunk | |
11:18 | 201504 two stars check-in: 17bcf7e37c user: nnz tags: trunk | |
Changes
Modified aoc2015.c from [ccb46b8722] to [2cf16828ff].
1 2 3 4 5 6 7 8 9 10 11 12 | 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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "aocdailies.h" #include "aocutils.h" void aoc201505(char *data, size_t len) { (void)len; // unused argument char *line = strtok(data, "\n"), *vtest; unsigned nice = 0; while (line) { if (!strstr(line, "ab")) { if (!strstr(line, "cd")) { if (!strstr(line, "pq")) { if (!strstr(line, "xy")) { for (vtest = line; vtest[1]; vtest++) { if (vtest[0] == vtest[1]) break; } if (vtest[0] == vtest[1]) { unsigned vowels = 0; for (vtest = line; *vtest; vtest++) { if (strchr("aeiou", *vtest)) vowels++; if (vowels == 3) break; } nice += (vowels == 3); } } } } } line = strtok(NULL, "\n"); } printf("There are %u nice strings.\n", nice); } void aoc201504(char *data, size_t len) { data[--len] = 0; // remove newline, adjust `len` char longkey[128]; unsigned extra = 1; for (;;) { sprintf(longkey, "%s%u", data, extra); |
︙ |
Modified aocdailies.c from [53d57bd116] to [f37c08030f].
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - + | case 201512: p = aoc201512; break; case 201511: p = aoc201511; break; case 201510: p = aoc201510; break; case 201509: p = aoc201509; break; case 201508: p = aoc201508; break; case 201507: p = aoc201507; break; case 201506: p = aoc201506; break; |
︙ |
Modified aocdailies.h from [e29d12fccf] to [3ea2baaa69].
︙ | |||
33 34 35 36 37 38 39 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | - + | aocfunc aoc201512; aocfunc aoc201511; aocfunc aoc201510; aocfunc aoc201509; aocfunc aoc201508; aocfunc aoc201507; aocfunc aoc201506; |