Advent of Code

Diff
Login

Diff

Differences From Artifact [5531243aa8]:

To Artifact [b9786e59e9]:


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    if (data[rcmap(size, row-1, col-1)] == 'S') tmp |= 2;
    if (data[rcmap(size, row-1, col+1)] == 'M') tmp |= 4;
    if (data[rcmap(size, row-1, col+1)] == 'S') tmp |= 8;
    if (data[rcmap(size, row+1, col+1)] == 'M') tmp |= 1;
    if (data[rcmap(size, row+1, col+1)] == 'S') tmp |= 2;
    if (data[rcmap(size, row+1, col-1)] == 'M') tmp |= 4;
    if (data[rcmap(size, row+1, col-1)] == 'S') tmp |= 8;
    return tmp == 15;
}

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







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
    if (data[rcmap(size, row-1, col-1)] == 'S') tmp |= 2;
    if (data[rcmap(size, row-1, col+1)] == 'M') tmp |= 4;
    if (data[rcmap(size, row-1, col+1)] == 'S') tmp |= 8;
    if (data[rcmap(size, row+1, col+1)] == 'M') tmp |= 1;
    if (data[rcmap(size, row+1, col+1)] == 'S') tmp |= 2;
    if (data[rcmap(size, row+1, col-1)] == 'M') tmp |= 4;
    if (data[rcmap(size, row+1, col-1)] == 'S') tmp |= 8;
    return (tmp == 15);
}

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