bjorng

bjorng

Erlang Core Team

Advent of Code 2019 - Day 15

Note: This topic is to talk about Day 15 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

Most Liked

sasajuric

sasajuric

Author of Elixir In Action

My original pure-functional design of Intcode definitely payed off today! Doing a breadth-first search (which I used to solve both parts) was straightforward. There is some duplication in the solution for each part, and I spend short time figuring out if I could make a more generic BFS abstraction, but in the end I didn’t feel it’s worth it. I might explore this in the future. Anyway, here’s my solution.

cblavier

cblavier

I just had a look at everyone’s solution and I’m surprised to notice that (for once) my solution is among the shortest (30 lines for each part).

Nothing fancy in my code though, it was a pretty straightforward tree traversal :face_with_monocle:

bjorng

bjorng

Erlang Core Team

I changed my Intcode module back to be fully functional (not using processes or message passing).

Here is my solution.

ihabunek

ihabunek

Slightly overcomplicated it by using Dijkstra for part 1, which is not required due to all edges being the same weight:
https://git.sr.ht/~ihabunek/aoc2019/tree/master/lib/day15.ex

I animated the result again:
https://asciinema.org/a/80grPw4uGhl2GTBQjz33hSKip

jenarvaezg

jenarvaezg

Since I was short on time, I just went roomba style for part 1 (random movement, preffering unexplored areas to old areas) and drew the map, then I calculated part 1 and 2 by hand (not proud at all).

I will try to do this in a proper way later.
“solution”, part 2 is broken since I tried to explore correctly, by I’m out of time

Where Next?

Popular in Challenges Top

LostKobrakai
This topic is about Day 9 of the Advent of Code 2020 . Thanks to @egze, we have a private leaderboard: https://adventofcode.com/2020/le...
New
bismark
Took me a minute to remember my binary math :smile: :grimacing:… import Bitwise __DIR__ |> Path.join("puzzle.txt") |> File.stream...
New
Aetherus
This topic is about Day 3 of the Advent of Code 2020 . Thanks to @egze, we have a private leaderboard: https://adventofcode.com/2020/le...
New
sukhmeetsd
All in all, from what I understand, it is better not to use GenServer.cast when we want some concurrent operations to happen for sure, be...
New
Aetherus
Today’s challenge is quite interesting. I ended up using Zipper to solve this problem. Maybe I overengineered quite a bit. The data stru...
New
bjorng
Note: This topic is to talk about Day 2 of the Advent of Code 2019 . There is a private leaderboard for elixirforum members. You can joi...
New
stevensonmt
Anyone else think the prompt for this challenge is contradictory? The rules for comparing packets include If both values are lists, c...
New
kwando
Took a while, but another use case for “move vectors” today and pattern matching. :slight_smile: The trick was to first generate a list...
New
bjorng
This topic is about Day 10 of the Advent of Code 2021. We have a private leaderboard (shared with users of Erlang Forums ): https://adv...
New
mattbaker
I’m having so much fun working on the “Protohackers” challenges, I never got into Advent of Code much but this has been amazing. The chal...
New

Other popular topics Top

peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New

We're in Beta

About us Mission Statement