advent of code 2019, problem 15.2

For day 15 we are given the programme for a robot that can help us explore a maze.

3,1033,1008,1033,1,1032,1005,1032,31,1008,1033,2,1032,1005,1032,58,1008,1033,3,1032,1005,1032,81,1008,1033,4,1032,1005,1032,104,99,101,0,1034,1039,1002,1036,1,1041,1001,1035,-1,1040,1008,1038,0,1043,102,-1,1043,1032,1,1037,1032,1042,1105,1,124,1001,1034,0,1039,1001,1036,0,1041,1001,1035,1,1040,1008,1038,...

So we wrote a controller that used a simple wall follower maze solving algorithm to map out the maze.

While mapping the maze the robot tells us the location of an oxygen cylinder. The answer to part one is the distance from the robot’s starting location to the oxygen cylinder.

The answer to part to is to calculate how long it would take the oxygen to fill the maze assuming that the oxygen can move one step per minute.

The following video shows a simulation of the oxygen filling the maze.

Leave a Reply

%d bloggers like this: