From: Alexander Fedotov Date: Mon, 7 Mar 2016 18:34:18 +0000 (+0100) Subject: come cleaning X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=ea99b6c1a5c786744df79413b4ea0ec830e67be9;p=mc1516pa.git come cleaning --- diff --git a/code/SokobanCoord.icl b/code/SokobanCoord.icl index 0cce0c4..c23e282 100644 --- a/code/SokobanCoord.icl +++ b/code/SokobanCoord.icl @@ -2,9 +2,6 @@ module SokobanCoord import StdList, StdInt, StdChar, StdMisc, StdClass, StdString, StdFile, StdArray, StdTuple, Data.Maybe, Data.Map, Control.Monad, Data.Tuple, Data.Void -inputfile :== "screen.1" -outputfile :== "solver.smv" - :: SokobanPuzzle :== [[SokobanTile]] :: SokobanTile = Wall | Free | Box | Target | Agent @@ -24,55 +21,6 @@ checkX x = if (x > length (hd puzzle)) (-1) x checkY :: Int -> Int checkY y = if (y > length puzzle) (-1) y -/* - next(x2_2) := case - x2_2 = Wall: Wall; - - x2_2 = Free & x2_3 = Agent & move = Left: Agent; - x2_2 = Free & x3_2 = Agent & move = Up: Agent; - x2_2 = Free & x2_1 = Agent & move = Right : Agent; - x2_2 = Free & x1_2 = Agent & move = Down : Agent; - - x2_2 = Free & x2_3 = Box & x2_4 = Agent & move = Left: Box; - x2_2 = Free & x3_2 = Box & x4_2 = Agent & move = Up: Box; - x2_2 = Free & x2_1 = Box & x2_0 = Agent & move = Right : Box; - x2_2 = Free & x1_2 = Box & x0_2 = Agent & move = Down : Box; - - x2_2 = Agent & (x2_3 = Free | x2_3 = Target) & move = Right: Free; - x2_2 = Agent & (x3_2 = Free | x3_2 = Target) & move = Down: Free; - x2_2 = Agent & (x2_1 = Free | x2_1 = Target) & move = Left : Free; - x2_2 = Agent & (x1_2 = Free | x1_2 = Target) & move = Up : Free; - - x2_2 = Box & x2_3 = Agent & (x2_1 = Free | x2_1 = Target) & move = Left: Agent; - x2_2 = Box & x3_2 = Agent & (x1_2 = Free | x1_2 = Target) & move = Up: Agent; - x2_2 = Box & x2_1 = Agent & (x2_3 = Free | x2_3 = Target) & move = Right : Agent; - x2_2 = Box & x1_2 = Agent & (x3_2 = Free | x3_2 = Target) & move = Down : Agent; - - x2_2 = Target & x2_3 = Agent & move = Left: AgentOnTarget; - x2_2 = Target & x3_2 = Agent & move = Up: AgentOnTarget; - x2_2 = Target & x2_1 = Agent & move = Right : AgentOnTarget; - x2_2 = Target & x1_2 = Agent & move = Down : AgentOnTarget; - - x2_2 = Target & x2_3 = Box & x2_4 = Agent & move = Left: BoxOnTarget; - x2_2 = Target & x3_2 = Box & x4_2 = Agent & move = Up: BoxOnTarget; - x2_2 = Target & x2_1 = Box & x2_0 = Agent & move = Right : BoxOnTarget; - x2_2 = Target & x1_2 = Box & x0_2 = Agent & move = Down : BoxOnTarget; - - x2_2 = AgentOnTarget & (x2_3 = Free | x2_3 = Target) & move = Right: Target; - x2_2 = AgentOnTarget & (x3_2 = Free | x3_2 = Target) & move = Down: Target; - x2_2 = AgentOnTarget & (x2_1 = Free | x2_1 = Target) & move = Left : Target; - x2_2 = AgentOnTarget & (x1_2 = Free | x1_2 = Target) & move = Up : Target; - - x2_2 = BoxOnTarget & x2_3 = Agent & (x2_1 = Free | x2_1 = Target) & move = Left: AgentOnTarget; - x2_2 = BoxOnTarget & x3_2 = Agent & (x1_2 = Free | x1_2 = Target) & move = Up: AgentOnTarget; - x2_2 = BoxOnTarget & x2_1 = Agent & (x2_3 = Free | x2_3 = Target) & move = Right : AgentOnTarget; - x2_2 = BoxOnTarget & x1_2 = Agent & (x3_2 = Free | x3_2 = Target) & move = Down : AgentOnTarget; - - TRUE : x2_2; - esac; - -*/ - genCoord :: Int Int -> [String] genCoord x y = [" next(x" +++ toString x +++ "_" +++ toString y +++ ") := case\n", " x" +++ toString x +++ "_" +++ toString y +++ " = Wall: Wall;\n",