Overview
| Comment: | not that it matters, but bug squashed |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
aec632be32669cf170a171395cedd700 |
| User & Date: | nnz on 2024-12-06 16:45:03.165 |
| Other Links: | manifest | tags |
Context
|
2024-12-07
| ||
| 09:35 | 202407 -- answer too low, maybe got some overflowing check-in: 5cddab1bb6 user: nnz tags: trunk | |
|
2024-12-06
| ||
| 16:45 | not that it matters, but bug squashed check-in: aec632be32 user: nnz tags: trunk | |
| 16:32 | 202406 confirm 4 for repetitions check-in: fc7808669f user: nnz tags: trunk | |
Changes
Modified aoc2024.c
from [f86e25f6c6]
to [8003dbb812].
| ︙ | ︙ | |||
64 65 66 67 68 69 70 |
row_pos = row_initial; col_pos = col_initial;
deltarow = -1; deltacol = 0;
data[linearize2d(size, (unsigned)row_pos, (unsigned)col_pos)] = '1';
bool looping = false;
while (!looping && validpos(size, row_pos + deltarow, col_pos + deltacol)) {
switch (data[linearize2d(size, (unsigned)(row_pos+deltarow), (unsigned)(col_pos+deltacol))]) {
default: puts("stepped on default"); exit(EXIT_FAILURE);
| | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
row_pos = row_initial; col_pos = col_initial;
deltarow = -1; deltacol = 0;
data[linearize2d(size, (unsigned)row_pos, (unsigned)col_pos)] = '1';
bool looping = false;
while (!looping && validpos(size, row_pos + deltarow, col_pos + deltacol)) {
switch (data[linearize2d(size, (unsigned)(row_pos+deltarow), (unsigned)(col_pos+deltacol))]) {
default: puts("stepped on default"); exit(EXIT_FAILURE);
case '#': if (data[linearize2d(size, (unsigned)(row_pos), (unsigned)(col_pos))] == '4') looping = true;
rightturn(&deltarow, &deltacol);
break;
case '4': looping = true; break;
case '.': data[linearize2d(size, (unsigned)(row_pos+deltarow), (unsigned)(col_pos+deltacol))] = '0';
/*fallthrough*/
case '1':
case '2':
|
| ︙ | ︙ |