From ffbe00b0e61738443c25463fd26c24a71173d4c3 Mon Sep 17 00:00:00 2001 From: Alexander Fedotov Date: Thu, 10 Mar 2016 22:11:57 +0100 Subject: [PATCH] small clean-up --- code/SokobanCoord.icl | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) 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" -- 2.20.1