Index: aoc2024.c ================================================================== --- aoc2024.c +++ aoc2024.c @@ -60,18 +60,10 @@ case 2: calibrationtotal += testvalue; __attribute__((fallthrough)); case 3: calibration3total += testvalue; break; } - #if 0 - if (canbetrue(testvalue, number, nnumber)) { - calibrationtotal += testvalue; - } - if (canbetrue3(testvalue, number, nnumber)) { - calibration3total += testvalue; - } - #endif line = strtok(NULL, "\n"); } printf("The calibration total is {%llu}.\n", calibrationtotal); printf("The calibration total with three operators is {%llu}.\n", calibration3total); } @@ -284,22 +276,10 @@ 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 size = strchr(data, '\n') - data; - #if 0 // check assumption - printf("data has %u cols, first three rows start with %c%c, %c%c, and %c%c.\n", - size, data[0], data[1], - data[1*(size+1)], data[1*(size+1)+1], - data[2*(size+1)], data[2*(size+1)+1]); - printf("ends with %c%c.\n", data[(size-1)*(size+1) + size-2], data[(size-1)*(size+1)+size-1]); - printf("data has %u cols, first three rows start with %c%c, %c%c, and %c%c.\n", - size, data[linearize2d(size+1, 0, 0)], data[linearize2d(size+1, 0, 1)], - data[linearize2d(size+1, 1, 0)], data[linearize2d(size+1, 1, 1)], - data[linearize2d(size+1, 2, 0)], data[linearize2d(size+1, 2, 1)]); - printf("ends with %c%c.\n", data[linearize2d(size+1, size-1, size-2)], data[linearize2d(size+1, size-1, size-1)]); - #endif unsigned xmascount = 0, Xmascount = 0; for (unsigned row = 0; row < size; row++) { for (unsigned col = 0; col < size; col++) { xmascount += xmasat(data, size, row, col); if ((1 <= row) && (row < size - 1) && (1 <= col) && (col < size - 1)) {