Advent of Code - 2019 - Day 23 - 24

The twenty-third problem was about running NICs (in Intcode) and simulate a network. Part 1 was quick, just create 50 Intcode processes and then take care of routing messages. Finally, abort once a packet is sent to the NAT controller (address 255).

For part 2 we should also detect idleness in the network, I didn’t do anything fancy just once a full cycle without a packet occurs, decide the network is idle. Keep track of NAT messages and halt once it cycles.

7>  aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/23/sol_23.aes", "solve_1", []).
0 steps / 32864407 gas / 0 reductions / 1562.02ms
{revert,<<"Addr 255 is not routeable: (47969,17283)">>}
8>  aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/23/sol_23.aes", "solve_2", []).
0 steps / 8909324928 gas / 0 reductions / 29257.81ms
11319

My solution is here

2 Likes

I don’t even understand the questions and you solve them with Sophia…

Great job and impressive to see.

The twenty-fourth problem was about a variant of game of life. I solved part 1 using Bit-arrays (bits) since we had to score the first repeated game board and that score was exactly the bit array :slight_smile: The twist for part 2 was to make the board infinitely recursive - though we only had to make 200 iterations so the size was manageable. Since it is Christmas I didn’t have time to optimize it, one could limit the computation quite a bit rather easily. But it runs in about 5 minutes.

162> aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/24/sol_24.aes", "solve_1", []).
0 steps / 1600333 gas / 0 reductions / 241.96ms
{bits,17321586}
163> aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/24/sol_24.aes", "solve_2", [200]).
0 steps / 2572446815615 gas / 0 reductions / 273581.75ms
1921

My solution is here

1 Like

Haha - Merry Christmas! Great job!