Refactor level/room generation modules
This commit is contained in:
@@ -23,6 +23,7 @@ takeOneWeighted ws xs = state (randomR (0, sum ws))
|
||||
i y _ = 0
|
||||
|
||||
takeOneMore :: RandomGen g => ([a],[a]) -> State g ([a],[a])
|
||||
takeOneMore (xs,[]) = error "trying to takeOneMore from empty list"
|
||||
takeOneMore (xs,ys) = do
|
||||
i <- state $ randomR (0,length ys - 1)
|
||||
let (zs, w:ws) = splitAt i ys
|
||||
|
||||
Reference in New Issue
Block a user