From 1e7a402d031f0cc76bea24f9dd6df8f5230dd7ca Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Mon, 10 Dec 2018 01:06:38 -0500 Subject: Solve day 10 part 2 --- 2018/day10.c | 3 +++ 1 file changed, 3 insertions(+) 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); } -- cgit 1.4.1