summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-11 18:20:46 -0500
committerJune McEnroe <june@causal.agency>2020-11-22 00:14:26 -0500
commitf1f9968fb04901cfdafbe060416fb32da220b338 (patch)
treedae5ae6c33dce10dacc7dd23a9bb81f7f6acbaa8
parentSolve day 8 part 1 (diff)
downloadaoc-f1f9968fb04901cfdafbe060416fb32da220b338.tar.gz
aoc-f1f9968fb04901cfdafbe060416fb32da220b338.zip
Solve day 8 part 2
Diffstat (limited to '')
-rw-r--r--2019/day08.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/2019/day08.c b/2019/day08.c
index 05011c8..4ddbc60 100644
--- a/2019/day08.c
+++ b/2019/day08.c
@@ -25,4 +25,19 @@ int main(void) {
 		}
 	}
 	printf("%d\n", one * two);
+
+	char img[6][25];
+	for (size_t l = len - 1; l < len; --l) {
+		for (int y = 0; y < 6; ++y) {
+			for (int x = 0; x < 25; ++x) {
+				switch (layers[l][y][x]) {
+					break; case '0': img[y][x] = '.';
+					break; case '1': img[y][x] = '#';
+				}
+			}
+		}
+	}
+	for (int y = 0; y < 6; ++y) {
+		printf("%.*s\n", 25, img[y]);
+	}
 }