, ct :: Int
}
-- deriving (Eq, Ord, Show)
- deriving (Eq, Show)
+ deriving (Show)
+
+instance Eq Explorer where
+ e1 == e2 = pos e1 == pos e2
+
instance Ord Explorer where
compare e1 e2 = compare (pos e1) (pos e2)
- -- compare e1 e2 = case pc of
- -- EQ -> compare (ct e1) (ct e2)
- -- _ -> pc
- -- where pc = compare (pos e1) (pos e2)
-
--- type Explorer = Position
memoryBounds :: (Position, Position)
-- memoryBounds = (V2 0 0, V2 6 6)
where (V2 dx dy) = e.pos ^-^ memory.goal
initial :: Memory -> Explorer
--- initial memory = Explorer { pos = memory.start }
initial memory = Explorer { pos = memory.start, ct = 0 }
-- parse the input file