From 6e86ea5919c02070a9c01cd84ff4ce7685c3f079 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Fri, 9 Dec 2022 17:02:57 +0000 Subject: Cleanup puzzle 9 part 1 Now that we fixed the bug, get rid of debug output. --- 9.c | 9 --------- 1 file changed, 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"); } } -- cgit v1.2.1