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
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
Day 8 solution. Fairly straightforward, not very efficient.
Also, damn that was one tricky captcha. 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.
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
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
.
My solution. Instead of printing chars directly, I converted the image into an iolist, which can be IO.puts
-ed.
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”
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:
Eh… Didn’t fully solve this in Elixir, because it’s not really worth it to implement OCR.
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.
Almost back up to date on Day 8: