Index: aoc2024.c ================================================================== --- aoc2024.c +++ aoc2024.c @@ -72,11 +72,11 @@ 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); + 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);