Overview
Comment: | 202406 1st star |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a114787839b74b84050212fa468ac8c1 |
User & Date: | nnz on 2024-12-06 12:56:21 |
Other Links: | manifest | tags |
Context
2024-12-06
| ||
13:49 | ready for brute force check-in: aca10ca251 user: nnz tags: trunk | |
12:56 | 202406 1st star check-in: a114787839 user: nnz tags: trunk | |
12:05 | moved and renamed function to aocutils.c check-in: 682dabca63 user: nnz tags: trunk | |
Changes
Modified aoc2024.c from [9785441a22] to [445ebe9c15].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + | #include <ctype.h> #include <stdbool.h> #include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "aocdailies.h" #include "aocutils.h" /* === aoc202406 ======================================================= Hmmm, I've done something like this already this year... on day 4 I need rcmap() moved to aocutils ... done; now it's called `linearize2d` ===================================================================== */ static bool validpos(unsigned s, int r, int c) { if (r < 0) return false; if (c < 0) return false; if ((unsigned)r >= s - 1) return false; if ((unsigned)c >= s - 1) return false; return true; } static void rightturn(int *drow, int *dcol) { if (*drow) { *dcol = -*drow; *drow = 0; } else { *drow = *dcol; *dcol = 0; } } void aoc202406(char *data, size_t len) { |
︙ |