Fix bug that allowed for in links to be used as out links
This commit is contained in:
@@ -84,7 +84,7 @@ updateSingleNode f update t@(Node x ts)
|
||||
updateChildren = map (Node x) (subMap (updateSingleNode f update) ts)
|
||||
|
||||
subMap :: (a -> [a]) -> [a] -> [[a]]
|
||||
subMap f (x:xs) = (f x <&> (: xs)) ++ ( (x :) <$> (subMap f xs) )
|
||||
subMap f (x:xs) = (f x <&> (: xs)) ++ ( (x :) <$> subMap f xs )
|
||||
subMap _ [] = []
|
||||
|
||||
--subMap' :: Monad m => (a -> m a) -> [a] -> m [a]
|
||||
|
||||
@@ -33,10 +33,10 @@ posRms bounds (parent,_) _ [] st = case st of
|
||||
Node childi ts :<| tseq
|
||||
-> fmap (finalLinksUpdate parent:) <$> posRms bounds childi 0 ts tseq
|
||||
posRms bounds parenti@(pr,i) numChild (t@(Node (cr,i') _):ts) tseq = do
|
||||
putStr $ (rpns 20 (_rmName cr ++ "-" ++ show i'))
|
||||
++ (rpns 9 (" child " ++ show numChild ))
|
||||
++ (rpns 25 (" of " ++ _rmName pr ++ "-" ++ show i ))
|
||||
tryLinks (0::Int) (_rmLinks parent)
|
||||
putStr $ rpns 20 (_rmName cr ++ "-" ++ show i')
|
||||
++ rpns 9 (" child " ++ show numChild )
|
||||
++ rpns 25 (" of " ++ _rmName pr ++ "-" ++ show i )
|
||||
tryLinks (0::Int) (init $ _rmLinks parent)
|
||||
where
|
||||
rpns x s = rightPadNoSquash x ' ' s
|
||||
parent = fst parenti
|
||||
@@ -50,9 +50,9 @@ posRms bounds parenti@(pr,i) numChild (t@(Node (cr,i') _):ts) tseq = do
|
||||
case mayrs of
|
||||
--Nothing -> putStr ("Backtracking to room " ++ show i' ++ ": ") >> tryLinks (j+1) ls
|
||||
Nothing -> do
|
||||
putStr $ "Backtracking to " ++ (rpns 20 (_rmName cr ++ "-" ++ show i'))
|
||||
++ (rpns 9 (" child " ++ show numChild ))
|
||||
++ (rpns 25 (" of " ++ _rmName pr ++ "-" ++ show i ))
|
||||
putStr $ "Backtracking to " ++ rpns 20 (_rmName cr ++ "-" ++ show i')
|
||||
++ rpns 9 (" child " ++ show numChild )
|
||||
++ rpns 25 (" of " ++ _rmName pr ++ "-" ++ show i )
|
||||
tryLinks (j+1) ls
|
||||
Just rs -> return (Just rs)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user