Advent of Code

Diff
Login

Diff

Differences From Artifact [bd078583fe]:

To Artifact [5531243aa8]:


70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
    printf("ends with %c%c.\n", data[rcmap(size, size-1, size-2)], data[rcmap(size, 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)) {
                Xmascount += Xmasat(data, size, row, col);
            }
        }
    }
    printf("XMAS appears %u times in the little Elf's word search.\n", xmascount);
    printf("X-MAS appears %u times in the little Elf's word search.\n", Xmascount);
}








|







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
    printf("ends with %c%c.\n", data[rcmap(size, size-1, size-2)], data[rcmap(size, 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)) {
                if (Xmasat(data, size, row, col)) Xmascount++;
            }
        }
    }
    printf("XMAS appears %u times in the little Elf's word search.\n", xmascount);
    printf("X-MAS appears %u times in the little Elf's word search.\n", Xmascount);
}