a guest Apr 16th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. The spiral algorithm works by assigning the length of the sides of the room as 5.5m (in actuality it is 6m, but due to Dennis' diameter of approximately 35cm we left 50cm as it is impossible for him to travel more than 5.65m parallel with the x or y axes).  As can be seen from the diagram, if we let the first side be denoted by length {tau}, the first three sides Dennis must travel {tau}.  Each time Dennis finishes an edge, we increment turnCount, and when turnCount becomes greater than three (inclusive) and every two sides thereafter, Dennis' diameter must be subtracted from {tau}, such that {tau} can be described by (5.5 - (ceiling((turnCount-2)/2)*circumference)) for all sides after the first.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand