summary refs log tree commit diff homepage
path: root/2018
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-10 01:06:38 -0500
committerJune McEnroe <june@causal.agency>2020-11-22 00:14:25 -0500
commit1e7a402d031f0cc76bea24f9dd6df8f5230dd7ca (patch)
treed27d6d1d20342f5ccab5be9b9569ba58996fcc9e /2018
parentSolve day 10 part 1 (diff)
downloadaoc-1e7a402d031f0cc76bea24f9dd6df8f5230dd7ca.tar.gz
aoc-1e7a402d031f0cc76bea24f9dd6df8f5230dd7ca.zip
Solve day 10 part 2
Diffstat (limited to '2018')
-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);
 }