From 6c1c0ba84ad6178629147dce00cc5432d40c39f1 Mon Sep 17 00:00:00 2001 From: Alexander Fedotov Date: Thu, 10 Mar 2016 12:27:46 +0100 Subject: [PATCH] coord gen small fix + cleanup --- code/SokobanCoord.icl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/SokobanCoord.icl b/code/SokobanCoord.icl index 4a664ad..dfbc60f 100644 --- a/code/SokobanCoord.icl +++ b/code/SokobanCoord.icl @@ -6,18 +6,20 @@ import Sokoban inpath :== "screen.2000" 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]] +*/ checkX :: [[SokobanTile]] Int -> Int -checkX p x = let (Sokoban p) = puzzle in if (x > (length p - 1)) (-1) x +checkX p x = if (x > (length p - 1)) (-1) x checkY :: [[SokobanTile]] Int Int -> Int -checkY p x y = let (Sokoban p) = puzzle in if (y > (length (p !! x) - 1)) (-1) y +checkY p x y = if (y > (length (p !! x) - 1)) (-1) y genField :: [[SokobanTile]] Int Int -> String genField p x y = " init(x" +++ toString x +++ "_" +++ toString y +++ ") := " +++ fromTile ((p !! x) !! y) +++ ";\n" -- 2.20.1