p7/State.hs

23 lines
477 B
Haskell
Raw Normal View History

2018-06-24 17:26:43 -04:00
module State where
2018-06-24 19:21:29 -04:00
import System.Random
import Packs
2018-06-24 17:26:43 -04:00
type State = (Pool, BoxQueue, StdGen)
2018-06-24 19:47:53 -04:00
data InRot = Ir DataPack deriving (Show, Eq)
2018-06-24 19:21:29 -04:00
2018-06-24 17:26:43 -04:00
data OutRot = Or DataPack Integer
2018-06-24 19:21:29 -04:00
instance Eq OutRot where
(Or d1 _) == (Or d2 _) = d1 == d2
2018-06-24 17:26:43 -04:00
data BoxQueue = Bq [Maybe BigBox]
type Pool = ([InRot], [OutRot])
createInRot :: [DataPack] -> [InRot]
createInRot x = map (\n -> Ir n) x
createOutRot :: [DataPack] -> [OutRot]
createOutRot x = map (\n -> Or n 0) x