From: Alexander Fedotov Date: Thu, 10 Mar 2016 21:11:57 +0000 (+0100) Subject: small clean-up X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=ffbe00b0e61738443c25463fd26c24a71173d4c3;p=mc1516pa.git small clean-up --- diff --git a/code/SokobanCoord.icl b/code/SokobanCoord.icl index c082875..c3f2844 100644 --- a/code/SokobanCoord.icl +++ b/code/SokobanCoord.icl @@ -6,26 +6,6 @@ import Sokoban inpath :== "screen.2001" outpath :== "solver.smv" -/* -puzzle :: SokobanPuzzle -puzzle = Sokoban [[Wall, Wall, Wall, Wall, Wall, Wall], - [Wall, Free, Free, Free, Free, Wall], - [Wall, Agent,Free, Box, Free, Wall], - [Wall, Free, Free, Free, Target, Wall], - [Wall, Wall, Wall, Wall, Wall, Wall]] -*/ - -instance == SokobanTile -where - (==) Wall Wall = True - (==) Free Free = True - (==) Box Box = True - (==) Agent Agent = True - (==) Target Target = True - (==) TargetBox TargetBox = True - (==) TargetAgent TargetAgent = True - (==) _ _ = False - checkX :: [[SokobanTile]] Int -> Int checkX p x = if (x > (length p - 1)) (-1) x @@ -91,6 +71,17 @@ genCoord p x y = [" next(x" +++ toString x +++ "_" +++ toString y +++ ") := cas " esac;\n" ] +instance == SokobanTile +where + (==) Wall Wall = True + (==) Free Free = True + (==) Box Box = True + (==) Agent Agent = True + (==) Target Target = True + (==) TargetBox TargetBox = True + (==) TargetAgent TargetAgent = True + (==) _ _ = False + fromTile :: SokobanTile -> String fromTile Wall = "Wall" fromTile Free = "Free"