Skip to content

Instantly share code, notes, and snippets.

@zivce
Created March 31, 2021 20:04
Show Gist options
  • Save zivce/42ca957f5640d0dd4c0a2806048de3c1 to your computer and use it in GitHub Desktop.
Save zivce/42ca957f5640d0dd4c0a2806048de3c1 to your computer and use it in GitHub Desktop.
(defun seekDFSCircle (startLocation directNeighbors tilesMap)
(cond
((endp directNeighbors)
nil
)
(t
(let*
(
(directNeighbor (car directNeighbors))
(direction (getTileDirection directNeighbor startLocation))
(remaining (list (list directNeighbor direction)))
(visited '())
)
(if (isClosedChain startLocation remaining visited tilesMap)
T
(seekDFSCircle startLocation (cdr directNeighbors) tilesMap)
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment