Meh. I'm not a fan of the "reverse engineer this m...
# advent-of-code
t
Meh. I'm not a fan of the "reverse engineer this machine code" puzzles.
l
I am skipping day 19 too. It shouldn't be hard to solve (I think), but already reading the puzzle instructions makes my brain feel sick 😁.
t
I just wrote it up but haven't published it yet. I totally punted on part 2. I'm just slammed with work today and didn't have time to really write up a walthrough on it. But I do understand it. Part 1 is actually just reusing most of day 16's code...
g
How i figured things out, was first printing out a certain operation, then find the 'borders' when the value isn't just increasing. Print the borders, find our what needs to be done to jump from start to finish, once you have that you can further optimize your code.
a
Part 1 was v straightforward. Part 2 was harder, I started by identifying all the points in the code that assigned values to the IndexPointer as these were the branch/loop structure. Not sure how similar the input files were but mine was basically split into 2 parts. The last 18 lines were an initialisation block, with the main code in lines 1-16 were in 2 nested loops. There was a statement in the middle which squared the value of the IP register & so this acted as the Exit statement (ie. 16x16 takes the IP outside the program)
s
Love these kinds of problems, I get a little better at parsing the instructions each time (still slow though!)
g
They appeared to be very similar, with just the index pointer being in deferent locations, and two variables in the first part, setting the initial value.
j
Took me longer than I want to admit to realize I could substitute the value of the bound register for the line number of the current statement.... After that it was very much like last year's