from StdString import class toString
:: SokobanPuzzle = Sokoban [[SokobanTile]]
-:: SokobanTile = Wall | Free | Box | Target | Agent
+:: SokobanTile = Free | Wall | Box | Target | Agent | TargetAgent | TargetBox
instance toString SokobanTile
instance toString SokobanPuzzle
toString Box = "$"
toString Agent = "@"
toString Target = "."
+ toString TargetBox = "*"
+ toString TargetAgent = "+"
parse :: String *World -> (SokobanPuzzle, *World)
parse fp w
'$' = Box
'@' = Agent
'.' = Target
+ '+' = TargetAgent
+ '*' = TargetBox
' ' = Free
_ = abort ("Unknown char: '" +++ toString x +++ "'")
= ([current:rest], xs)