Advent of Code - Day 13

My solution to Day 13. I struggled with collision detection for a long time. Here is the cleaned up version of my code.