QuinnWilton
Advent of Code 2019 - Day 7
Note: This topic is to talk about Day 7 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
QuinnWilton
Here’s my solution: https://gist.github.com/QuinnWilton/e6fe3506240bf3abc4ef66c2f820a7e0
bjorng
Here is my solution.
In part 1, I spent a significant amount of the time to implement my permutations function to lazily generate all phases.
In part 2, I spent some time before I realized that it would have been much easier to run each of the amplifiers in their own Erlang process and rewrite input/output to use message passing. Oh, well! I didn’t do that refactoring, but made the machine suspend on an output operation and saving the IP to make it possible to resume it later when I had new input for it.
aaronnamba
Very nice, super clean. I did want to try processes + messages, which would have been the Elixir/Erlang way, but I am just not that comfortable with all that stuff yet.
aaronnamba
Part 1 was real easy, even though I haven’t bothered to fix up my Intcode computer like some of ya’ll have.
Part 2 actually wasn’t difficult either (just have to save state), except that both of the examples did not halt for me. After a while, I gave up trying to fix them and just ran the actual input and it worked. (Update: I realized that I have only been saving the instruction pointer value and not the memory. I am going to fix that real quick, but why did that even work??)
Code here, but I’m guessing our solutions for these intcode computer problems are just going to diverge more and more over time.
sasajuric
This was a fun challenge! My solution is completely sequential. I solved part 1 as a special case of part 2.
Nice! I also went for lazy permutation. Here’s my approach.







