Advent of Code - 2019 - Day 19 - 20

Day 19

The nineteenth problem problem was about an Intcode program (of course). The program described a beam in 2D space. For part 1 you had to run the program 2500 times (or you could be clever, but since this was entirely feasible in minutes, why bother!). For part 2 you had to trace the outline of the beam but again nice and easy compared to yesterday!

64> aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/19/sol_19.aes", "solve_1", []).
0 steps / 175755223649 gas / 0 reductions / 130745.37ms
141
65> aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/19/sol_19.aes", "solve_2", []).
0 steps / 53045376977 gas / 0 reductions / 106968.82ms
{tuple,{1564,1348,15641348}}

My solution is here

3 Likes

The twentieth problem problem was yet another maze. Part of the problem was to parse the input, but since we still lack some string functions in Sophia we did some pre-processing. Once in place part 1 was a simple breadth-first search. Part 2 was a bit more tricky, where we were to visit several instances of the maze.

19> aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/20/sol_20.aes", "solve_1", []).
0 steps / 218213962 gas / 0 reductions / 1425.99ms
654
22> aefa_sophia_test:run_file("/Users/hans/Personal/Repos/AoC2019/20/sol_20.aes", "solve_2", []).
0 steps / 140855720130 gas / 0 reductions / 36148.79ms
7360

My solution is here

1 Like