Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def from(paths: Set[Path], explored: Set[State]): Stream[Set[Path]] = {
- if (paths.isEmpty) Stream.empty
- else {
- val more = for {
- path <- paths
- next <- moves map path.extend
- if !explored.contains(next.finalState)
- } yield next
- paths #:: from(more, explored ++ more.map(_.finalState))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment