I think I have found the most ridiculous workaround ever. It involves this giant conditional direction:
But because of this error with (is Related) I have coded blindly, so I don’t yet know if it works. There is also the possible direction function bugs to consider.. I just can’t let go of a challenge.
Code:
(define "ConditionalDirection"
(if
(or {
(and {
(and {
(is Empty (ahead (from) NNW))
(is Empty (ahead (from) NNE))
(is Related Orthogonal
(ahead (from) NNW)
(ahead (from) NNE)
)
})
(and {
(is Empty (ahead (from) SSE))
(is Empty (ahead (from) SSW))
(is Related Orthogonal
(ahead (from) SSE)
(ahead (from) SSW)
)
})
})
(and {
(and {
(is Empty (ahead (from) NNW))
(is Empty (ahead (from) W))
(is Related Orthogonal
(ahead (from) NNW)
(ahead (from) W)
)
})
(and {
(is Empty (ahead (from) SSE))
(is Empty (ahead (from) E))
(is Related Orthogonal
(ahead (from) SSE)
(ahead (from) E)
)
})
})
(and {
(and {
(is Empty (ahead (from) NNE))
(is Empty (ahead (from) E))
(is Related Orthogonal
(ahead (from) NNE)
(ahead (from) E)
)
})
(and {
(is Empty (ahead (from) SSW))
(is Empty (ahead (from) W))
(is Related Orthogonal
(ahead (from) SSW)
(ahead (from) W)
)
})
})
})
Orthogonal
(if
(and {
(is Empty (ahead (from) NNW))
(is Empty (ahead (from) NNE))
(is Related Orthogonal
(ahead (from) NNW)
(ahead (from) NNE)
)
})
(directions {NNW NNE})
(if
(and {
(is Empty (ahead (from) SSE))
(is Empty (ahead (from) SSW))
(is Related Orthogonal
(ahead (from) SSE)
(ahead (from) SSW)
)
})
(directions {SSE SSW})
(if
(and {
(is Empty (ahead (from) NNW))
(is Empty (ahead (from) W))
(is Related Orthogonal
(ahead (from) NNW)
(ahead (from) W)
)
})
(directions {NNW W})
(if
(and {
(is Empty (ahead (from) SSE))
(is Empty (ahead (from) E))
(is Related Orthogonal
(ahead (from) SSE)
(ahead (from) E)
)
})
(directions {SSE E})
(if
(and {
(is Empty (ahead (from) NNE))
(is Empty (ahead (from) E))
(is Related Orthogonal
(ahead (from) NNE)
(ahead (from) E)
)
})
(directions {NNE E})
(directions {SSW W})
)
)
)
)
)
)
)