Guest User

Untitled

a guest
Jul 10th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.37 KB | None | 0 0
  1.     def from(paths: Set[Path], explored: Set[State]): Stream[Set[Path]] = {
  2.       if (paths.isEmpty) Stream.empty
  3.       else {
  4.         val more = for {
  5.           path <- paths
  6.           next <- moves map path.extend
  7.           if !explored.contains(next.finalState)
  8.         } yield next
  9.  
  10.         paths #:: from(more, explored ++ more.map(_.finalState))
  11.       }
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment