X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=code%2FSokoban.dcl;h=f50328733a25bbd17fc72676072d349695bd17f4;hb=528cda8a5116dbed02a1e603d7fca2033dd0c100;hp=30e9465e163abfc5518b5736db1da3ffbe9ac1db;hpb=9754f5cfb7a38d480ecf72dc87d4c67cd774c9d7;p=mc1516pa.git diff --git a/code/Sokoban.dcl b/code/Sokoban.dcl index 30e9465..f503287 100644 --- a/code/Sokoban.dcl +++ b/code/Sokoban.dcl @@ -1,9 +1,14 @@ definition module Sokoban -:: SokobanPuzzle = { - width :: Int, - height :: Int, - data :: [[SokobanTile]]} -:: SokobanTile = Wall | Free | Box | Target +from StdString import class toString + +:: SokobanPuzzle = Sokoban [[SokobanTile]] +:: SokobanTile = Free | Wall | Box | Target | Agent | TargetAgent | TargetBox + +instance toString SokobanTile +instance toString SokobanPuzzle parse :: String *World -> (SokobanPuzzle, *World) +parseFromFile :: *File -> (SokobanPuzzle, *File) + +numberOfBlocks :: SokobanPuzzle -> Int