Part 1
In this puzzle we have the same pseudo-assembly as in day 12. A new opcode "tgl" is added. This opcode modifies the source code itself by switching an opcode specified by an offset. We are again given a program and asked to find the output for a given input number.
We reused the answer from day 12 and implemented the new opcode. For speeding up the execution, we also replaced the regex run every cycle with a simple string splitting and comparison. This was enough to get the answer for part 1.
No comments:
Post a Comment