Advent of Code

Check-in [2f90165e39]
Login

Check-in [2f90165e39]

Overview
Comment:revamped the comma separated output
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2f90165e3918740e5929958aa50b5e54b5825188eef3dfbf86b4959c5c61016f
User & Date: nnz on 2025-01-09 19:37:29
Other Links: manifest | tags
Context
2025-01-12
15:44
202422 2nd star -- brute force 30 mins runtime check-in: 367ff5ba4e user: nnz tags: trunk
2025-01-09
19:37
revamped the comma separated output check-in: 2f90165e39 user: nnz tags: trunk
19:11
added TODO notes check-in: cb68a52d2d user: nnz tags: trunk
Changes

Modified aoc2024.c from [7e73975195] to [5c45b25c23].

92
93
94
95
96
97
98
99
100


101
102

103
104
105
106
107
108
109

110
111
112
113
114
115
116
92
93
94
95
96
97
98


99
100


101
102
103
104
105
106


107
108
109
110
111
112
113
114







-
-
+
+
-
-
+





-
-
+







    }
    unsigned output[100];
    size_t outlen = 0;
    unsigned ip = 0;
    while (ip + 1 < np) {
        ip = instruction(ip, p[ip], p[ip+1], reg, output, &outlen);
    }
    printf("Program's output is {");
    for (unsigned k = 0; k < outlen; k++) {
    printf("Program's output is {%u", output[0]);
    for (unsigned k = 1; k < outlen; k++) {
        if (k) putchar(',');
        putchar((int)output[k] + '0');
        printf(",%u", output[k]);
    }
    printf("}\n");

    printf("Program is          (%u", p[0]);
    for (unsigned k = 1; k < np; k++) {
        if (k) putchar(',');
        putchar((int)p[k] + '0');
        printf(",%u", p[k]);
    }
    printf(")\n");

    reg[3] = 202322936867370;
#if 0
    // I'm not happy with my "solution".
    // It wasn't the program who found it.