bjorng

bjorng

Erlang Core Team

Advent of Code 2019 - Day 9

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

bjorng

bjorng

Erlang Core Team

Here is my solution.

mason-bially

mason-bially

I got top 80-90! Here is the meat of my solution.

I specifically designed my intcode interpreter to allow rapid extension of it, I even spent an hour cleaning it up the other day, seems like that paid off.

It’s pretty cool to see how well a recursive interpreter of a self-modifying memory/code VM actually ends up working with immutable memory. Very fun.

I would also be curious about the timings people got on the second part. Mine was 3.860 seconds (timed from the shell).

sb8244

sb8244

Author of Real-Time Phoenix

Nothing too exciting in my code here. My intcode computer has overall been a bit of a mess due to not going back and cleaning it up.

This problem really showed some issues in how I had implicit rules baked into my code. I was not putting arg 3 through any type of mode checking, because it was always itself previously. That bit me hard today, and I had to spend a ton of time debugging why my stuff wasn’t working.

sasajuric

sasajuric

Author of Elixir In Action

This is my solution. So far I strived to keep the code clean, and this payed off, b/c the changes to the machine code were minimal. I finally extracted Intcode interpreter into a separate module, but I still keep that module code in the same file as the solution, so others can easily read the entire solution from a single file. As for the perf, the 2nd part takes about 500ms on my machine.

cblavier

cblavier

Thank you guys! :smiling_face_with_sunglasses:
Updated to a Map data structure, and it does all the difference!

Where Next?

Popular in Challenges Top

bjorng
Note: This topic is to talk about Day 16 of the Advent of Code 2019. There is a private leaderboard for elixirforum members. You can joi...
New
sasajuric
Note by the Moderators: This topic is to talk about Day 5 of the Advent of Code. For general discussion about the Advent of Code 2018 an...
New
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
stevensonmt
Anyone else think the prompt for this challenge is contradictory? The rules for comparing packets include If both values are lists, c...
New
New
stevensonmt
Reasonably pleased with my solution. The bitstring packet problems are so well suited to Erlang/Elixir it’s almost not fair. defmodule D...
New
bjorng
This topic is about Day 18 of the Advent of Code 2020 . Thanks to @egze, we have a private leaderboard: https://adventofcode.com/2020/l...
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
cblavier
Hi, there :wave: Today, I felt it was way more challenging! I went through part2 thanks to Agent based memoization (without memoization ...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
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
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
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
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement