AoC 2019 D25: Cryostasis
| Problem statement | Source code | Tags: IntcodePuzzleManual inspection
This is a problem I really enjoyed, especially the gaming part. I bet there are more elegant ways to do it, but C++ makes parsing strings a huge pain, so I just manually played the game and drew the map. This is the first truly "interactive" Intcode program, since day 13 was solved by an intelligence. The game loop looks like:
I need to step over all input instructions and then all output instructions, so exchange_msg looks like:
The map I drew is as follows:
I also experimented with which items are takeable. The final commands are:
Once I execute these commands, I am at the security checkpoint with all items. The final step is to try all combinations of items to pass the checkpoint. There are 8 items, so I can just enumerate all combinations of drop x and take x commands. If the program halts after going south, I know I passed the checkpoint.