Allow for random composition of trees
This commit is contained in:
@@ -14,15 +14,14 @@ import Dodge.Tree
|
||||
|
||||
import Control.Monad.State
|
||||
import System.Random
|
||||
import Data.Tree
|
||||
|
||||
branchRectWith :: RandomGen g => State g (SubCompTree Room) -> State g (SubCompTree Room)
|
||||
branchRectWith t = do
|
||||
x <- state $ randomR (100,200)
|
||||
y <- state $ randomR (100,200)
|
||||
b <- t
|
||||
root <- shuffleLinks $ roomRectAutoLinks x y
|
||||
return $ Node (PassDown root)
|
||||
rt <- shuffleLinks $ roomRectAutoLinks x y
|
||||
return $ Node (PassDown rt)
|
||||
[ Node (UseAll door) []
|
||||
, changeToPassDown <$> treeFromTrunk [PassDown door] b
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user