Advent of Code 2019 - Day 8

Note: This topic is to talk about Day 8 of the Advent of Code 2019.

There is a private leaderboard for elixirforum members. You can join it by following this link and entering the following code:

39276-eeb74f9a

1 Like

Here is my solution.

3 Likes

Here is mine. :slight_smile:

3 Likes

Day 8 solution. Fairly straightforward, not very efficient.

Also, damn that was one tricky captcha. :rofl: I lost a minute or so trying to figure out whether there were any letters in there, then once I found some, I lost another minute because I read one of them wrong the first time.

3 Likes

my solution
I used IO.ANSI to make the answer eaiser to read!

3 Likes

Ah… I did not know about IO.ANSI, and forgot about reduce_while.

It was much easier today! But it’s a good idea to have a more relaxing puzzle after yesterday’s crazy amplifier cluster :crazy_face:

My code: https://github.com/cblavier/advent/blob/master/lib/2019/day8/part2.ex

I found it was easier for my brain to process layers in reverse order (from back to front). It’s also the first time ever I use Enum.zip.

1 Like

My solution. Instead of printing chars directly, I converted the image into an iolist, which can be IO.puts-ed.

3 Likes

It was pretty straight forward today, took me about an hour on the wall, but I had to prepare my kids morning chocolate inbetween, so I’d guess it was about 30 to 45 minutes actual “CPU-time” :smiley:

Though I really do not like those CAPTCHA style problems. We had one of those last year (or the year before that), and there already the community overall really disliked it, as it created additional hurdles for the visually impaired.

After the rant, now my code:

3 Likes

Day 08.

2 Likes

Eh… Didn’t fully solve this in Elixir, because it’s not really worth it to implement OCR.

1 Like

My solution, I liked today’s puzzle.

2 Likes

Here’s mine, I’ve just put everything into part1 and part2 functions, piping the different steps. IO.ANSI colors made the message much more readable.

2 Likes

My solution. It helped me to keep the layers one dimensional for as long as possible.

2 Likes

Almost back up to date on Day 8:

1 Like