From af95e6aa20a7be982a0e91b8aa5ea46b22df4e8a Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Wed, 11 Dec 2019 18:20:46 -0500 Subject: Solve day 8 part 2 --- 2019/day08.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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]); + } } -- cgit 1.4.1