summary refs log tree commit diff homepage
path: root/2019
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-12-11 18:20:46 -0500
committerJune McEnroe <june@causal.agency>2019-12-11 18:20:46 -0500
commitaf95e6aa20a7be982a0e91b8aa5ea46b22df4e8a (patch)
treedf23ad862a66458206c85b7b85e1d458eb1f9ca8 /2019
parentSolve day 8 part 1 (diff)
downloadaoc-af95e6aa20a7be982a0e91b8aa5ea46b22df4e8a.tar.gz
aoc-af95e6aa20a7be982a0e91b8aa5ea46b22df4e8a.zip
Solve day 8 part 2
Diffstat (limited to '2019')
-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]);
+	}
 }
span>Add imbox and notemap to pageJune McEnroe 2020-02-12Collapse simple linksJune McEnroe 2020-02-12Move catgirl up the pageJune McEnroe 2020-02-12Update catgirl pty grabJune McEnroe 2020-02-12Link to cgit /about pages where appropriateJune McEnroe 2020-02-11Separate LINKS from BINS for html to workJune McEnroe 2020-02-11Add margin to Bl-bullet itemsJune McEnroe 2020-02-10Match URLs inside parens or with paired parens insideJune McEnroe 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe 2020-01-28Change scout sensitivity to 1.4June McEnroe 2020-01-28Import shows.txtJune McEnroe