; Counts the amount of elements in coll before element appears. Returns (count coll) if it doesn't appear at all.(defncount-until[elementcoll](count(take-while(partialnot=element)coll))); Calculates the minimum amount of traversals required in an orbit map to move from object to destination(defntraversals[orbit-mapobjectdestination](let[object-centers(orbit-centersorbit-mapobject)destination-centers(orbit-centersorbit-mapdestination)first-common-center(some(setdestination-centers)object-centers)](+(count-untilfirst-common-centerobject-centers)(count-untilfirst-common-centerdestination-centers))))
I just fetch the first common center of both objects and add the steps it takes to get there for both.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Oh, I will definitely look into that, thanks for the suggestion.
I only knew about (tree-seq),
I'm still a newbie in clj.
Zipper is extremely powerful for navigating trees efficiently.
It’s also as easy to read as overly point free Haskell.
I vastly improved it without using zippers now.
I just fetch the first common center of both objects and add the steps it takes to get there for both.