Pt 1 was easy, Pt 2 was pure horror.
Earlier drafts of the code tried to be way too
smart. At one point, I just came to the conclusion
to place a new obstacle (#) on the grid and just
rerun the thing to look for loops.
2 things:
- the visited positions from pt 1 can be used as a
subset for positions to consider for the extra
"#".
- The track of loops can be optimized to look at
bounces on "#"s instead of each individual y,x pos,
given that the direction is remembered.
pt 2 is familiar, the last time a puzzle required
look detection the puzzle used lazer beams and
reflectors. Not sure what Event or day it was.