shortestPathTo
Finds the shortest path to a given state using a naive recursive algorithm.
Note: includes this state by default.
// Given a simple state machine: [A] -> [B] -> [C]
A.shortestPathTo(C) // listOf(A, B, C)
A.shortestPathTo(A) // listOf(A)
Content copied to clipboard
Return
a list of states making up the shortest path.
Parameters
to
The state to find a path to.