Random tree structure generation of rooms
This commit is contained in:
@@ -29,7 +29,7 @@ treeTrunk (x:xs) t = Node x [treeTrunk xs t]
|
||||
Applies a function to the root of a tree.
|
||||
-}
|
||||
applyToRoot :: (a -> a) -> Tree a -> Tree a
|
||||
applyToRoot f (Node x xs) = Node (f x) xs
|
||||
applyToRoot f (Node t ts) = Node (f t) ts
|
||||
|
||||
treeSize = length . flatten
|
||||
|
||||
|
||||
Reference in New Issue
Block a user