repositories
/
mc1516pa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f299e42
)
added stub for boxonbox thing
author
Mart Lubbers
<mart@martlubbers.net>
Fri, 11 Mar 2016 10:49:58 +0000
(11:49 +0100)
committer
Mart Lubbers
<mart@martlubbers.net>
Fri, 11 Mar 2016 10:49:58 +0000
(11:49 +0100)
code/SokobanObjectwise.icl
patch
|
blob
|
history
diff --git
a/code/SokobanObjectwise.icl
b/code/SokobanObjectwise.icl
index
d51ee55
..
9dc09a1
100644
(file)
--- a/
code/SokobanObjectwise.icl
+++ b/
code/SokobanObjectwise.icl
@@
-56,6
+56,7
@@
encode p = join "\n" [
"INVAR (" <+ encodeGoalState (indexList boxes) targetPos <+
") <-> movement = finished;",
"INVAR " <+ encodeAgentNotOnBox (indexList boxes) <+ ";",
"INVAR (" <+ encodeGoalState (indexList boxes) targetPos <+
") <-> movement = finished;",
"INVAR " <+ encodeAgentNotOnBox (indexList boxes) <+ ";",
+ "INVAR " <+ encodeBoxesNotOnBox (indexList boxes),
"TRANS next(agent.x) = agent.x + dx;",
"TRANS next(agent.y) = agent.y + dy;",
encodeBlockMovement (indexList boxes),
"TRANS next(agent.x) = agent.x + dx;",
"TRANS next(agent.y) = agent.y + dy;",
encodeBlockMovement (indexList boxes),
@@
-120,6
+121,10
@@
encodeBlockMovement bs = join "\n" $ map ebm bs
"\t\tTRUE: b" <+ i <+ ".y + dy;\n" <+
"\tesac;"
"\t\tTRUE: b" <+ i <+ ".y + dy;\n" <+
"\tesac;"
+//TODO
+encodeBoxesNotOnBox :: [Int] -> String
+encodeBoxesNotOnBox _ = "TRUE;"
+
encodeAgentNotOnBox :: [Int] -> String
encodeAgentNotOnBox bs = join " &\n\t" [
"(b" <+ i <+ ".x != agent.x & b" <+ i <+ ".y != agent.y)"\\i<-bs]
encodeAgentNotOnBox :: [Int] -> String
encodeAgentNotOnBox bs = join " &\n\t" [
"(b" <+ i <+ ".x != agent.x & b" <+ i <+ ".y != agent.y)"\\i<-bs]