summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-10 01:06:38 -0500
committerJune McEnroe <june@causal.agency>2018-12-10 01:06:38 -0500
commit240146bc24a58372ca03219cc155eba95e4b91ce (patch)
tree0217dcdc911d101d889d38e5bf14a39e7c3b79d7
parentSolve day 10 part 1 (diff)
downloadaoc-240146bc24a58372ca03219cc155eba95e4b91ce.tar.gz
aoc-240146bc24a58372ca03219cc155eba95e4b91ce.zip
Solve day 10 part 2
-rw-r--r--2018/day10.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/2018/day10.c b/2018/day10.c
index b7044c5..dddae45 100644
--- a/2018/day10.c
+++ b/2018/day10.c
@@ -18,6 +18,7 @@ int main() {
 		len++;
 	}
 	int minX, minY, maxX, maxY;
+	int secs = 0;
 	do {
 		minX = minY = INT_MAX;
 		maxX = maxY = INT_MIN;
@@ -29,6 +30,7 @@ int main() {
 			if (points[i].x > maxX) maxX = points[i].x;
 			if (points[i].y > maxY) maxY = points[i].y;
 		}
+		secs++;
 	} while (maxY - minY > 9);
 	for (int y = minY; y <= maxY; ++y) {
 		for (int x = minX; x <= maxX; ++x) {
@@ -40,4 +42,5 @@ int main() {
 		}
 		printf("\n");
 	}
+	printf("%d\n", secs);
 }