Merge branch 'master' of git.martlubbers.net:clean-tests
[clean-tests.git] / afp / a10 / a10.icl
index 838f340..1da0267 100644 (file)
@@ -78,6 +78,14 @@ eval (WhileContainerBelow _ action) s
                = eval (action :. whileContainerBelow action) s
        = pure s
 
+opt :: (Action a b) -> Action a b
+opt (WhileContainerBelow b a) = WhileContainerBelow b (opt a)
+opt (Wait bm :. b) = opt (bm.f2 b)
+opt (a :. Wait bm) = opt (bm.t2 a)
+opt (a :. b) = opt a :. opt b
+opt x = x
+
+Start = opt (moveToShip :. wait :. moveDown)
 //print :: (Action i f) [String] -> [String]
 //print (MoveToShip _ _) s = ["Move to ship":s]
 //print (MoveToQuay _ _) s = ["Move to quay":s]