Instead of (f (g (h (j (k x))))) we can write
(-> (k x)
(j it)
(h it)
(g it)
(f it))
which is works really well for particularly large and complicated
expressions.
Annoying bug that took ages to fix: for multi-execute, there may be
times where movements go in complete diagonals. In this case, we need
to move in the unit vector diagonal direction. So I modified
update-tail for this case. Never happens in round 1 lol.
Pretty interesting, functional idioms kinda fail here as there are no
nice functions I can think of for the single-knot-execute-line
`dotimes` section. I could use tail recursion with an optimisation
but this is pretty explicit. You can compare execute-lines to
execute-line to see which type of iteration fits you.
Easy problem once I figured out the trick to constructing an
inherently stateful structure with backwards pointer references (at
least the first way I would've made it) into a functional alist
solution. Very cool.