summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2022-12-09 17:02:57 +0000
committerAdam Spragg <adam@spra.gg>2022-12-09 17:02:57 +0000
commit6e86ea5919c02070a9c01cd84ff4ce7685c3f079 (patch)
tree6bd4a3095202c3f2599066d00fdd24a18b3b4b42
parent4291faa39d4aad4a9cfed55600d32403422a2d4b (diff)
Cleanup puzzle 9 part 1
Now that we fixed the bug, get rid of debug output.
-rw-r--r--9.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/9.c b/9.c
index bd19cae..344c137 100644
--- a/9.c
+++ b/9.c
@@ -52,7 +52,6 @@ main()
tsearch(tail, &tails, point_tcmp);
tail = point_copy(tail);
++ntails;
- fprintf(stderr, "Tail visiting %d,%d\n", tail->x, tail->y);
while (fgets(buf, sizeof(buf), stdin)) {
int dist, dx, dy;
@@ -79,7 +78,6 @@ main()
fprintf(stderr, "Unexpected input: %s\n", buf);
return -1;
}
- fprintf(stderr, "Head %c %d to %d,%d\n", buf[0], dist, head.x, head.y);
dx = head.x - tail->x;
dy = head.y - tail->y;
@@ -102,21 +100,14 @@ main()
--tail->y;
++dy;
}
- fprintf(stderr, " Tail visiting %d,%d", tail->x, tail->y);
// Search/insert current tail in visited tails
pp = tsearch(tail, &tails, point_tcmp);
if (*pp == tail) {
// This was a new one, tail is now in the tree
- //fprintf(stderr, " (new)");
tail = point_copy(tail);
++ntails;
}
- else {
- fprintf(stderr, " (old)");
- }
-
- fprintf(stderr, "\n");
}
}