Files
loop/src/Dodge/Randify.hs
T

12 lines
292 B
Haskell

module Dodge.Randify where
import Control.Lens
import Control.Monad.State
import Dodge.Data.GenWorld
import System.Random
gRandify :: GenWorld -> State StdGen GenWorld -> GenWorld
gRandify gw mw =
let (gw', g) = runState mw (_randGen $ _gwWorld gw)
in gw' & gwWorld . randGen .~ g