module AsteroidModel where type Point = (Int, Int) type Angle = Int type Ship = (Point, Angle) type Asteroid = Point type Asteroids = [Asteroid] type State = (Maybe Ship, Asteroids) data Event = Right | Left | Down | Up | Shoot stateEqv :: State -> State -> Bool stateEqv (s1, as1) (s2, as2) = (shipEqv s1 s2) && (asteroidsEqv as1 as2) where shipEqv :: Maybe Ship -> Maybe Ship -> Bool shipEqv sh1 sh2 = case sh1 of Just ship1 -> ( case sh2 of Just ship2 -> True Nothing -> False ) Nothing -> ( case sh2 of Just ship2 -> False Nothing -> True ) asteroidsEqv :: Asteroids -> Asteroids -> Bool asteroidsEqv ast1 ast2 = (length ast1 == length ast2) winState :: [State] winState = [|]