Skip to content

Commit

Permalink
Use surveil to put most robots to sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
xsebek committed Jul 21, 2024
1 parent 64a1025 commit 3ff432a
Show file tree
Hide file tree
Showing 2 changed files with 215 additions and 125 deletions.
252 changes: 170 additions & 82 deletions data/scenarios/Tutorials/move.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,38 +80,38 @@ world:
palette:
'.': [blank]
'*': [blank, flower]
'X': [blank, null, 03 00 1 P flower]
'Y': [blank, null, 07 01 2 P flower]
'Z': [blank, null, 06 04 2 P flower]
'X': [blank, null, 1P flower]
'Y': [blank, null, 2P flower]
'Z': [blank, null, 3P flower]
# FIRST ROOM
'': [blank, upper left corner]
'': [blank, upper right corner, 03 00 1 S down and horizontal wall]
'': [blank, upper right corner, 1S down and horizontal]
'': [blank, lower left corner]
'': [blank, lower right corner, 03 00 1 S up and horizontal wall]
'': [blank, lower right corner, 1S up and horizontal]
'': [blank, horizontal wall]
'': [blank, vertical wall]
# SECOND ROOM
'1': [blank, vertical wall, 1G]
'-': [blank, null, 03 00 1 P horizontal wall]
'|': [blank, null, 03 00 1 P vertical wall]
'c': [blank, null, 03 00 1 P upper right corner, 07 01 2 S left and vertical wall]
'b': [blank, null, 03 00 1 P lower right corner]
'd': [blank, null, 03 00 1 P horizontal wall, 07 01 2 S up and horizontal wall]
'-': [blank, null, 1P horizontal]
'|': [blank, null, 1P vertical]
'c': [blank, null, 1P upper right, 1S left and vertical]
'b': [blank, null, 1P lower right corner]
'd': [blank, null, 1P horizontal, 2S up and horizontal]
# THIRD ROOM
'2': [blank, null, 03 00 1 P horizontal wall, 2G]
'~': [blank, null, 07 01 2 P horizontal wall]
'/': [blank, null, 07 01 2 P vertical wall]
'R': [blank, null, 07 01 2 P upper right corner]
'L': [blank, null, 07 01 2 P upper left corner, 06 04 2 S down and horizontal wall]
'K': [blank, null, 07 01 2 P vertical wall, 06 04 2 S left and vertical wall]
'2': [blank, null, 1P horizontal, 2G]
'~': [blank, null, 2P horizontal]
'/': [blank, null, 2P vertical]
'R': [blank, null, 2P upper right]
'L': [blank, null, 2P upper left, 3S down and horizontal]
'K': [blank, null, 2P vertical, 3S left and vertical]
# FOURTH ROOM
'3': [blank, null, 07 01 2 P vertical wall, 3G]
'_': [blank, null, 06 04 2 P horizontal wall]
'\': [blank, null, 06 04 2 P vertical wall]
'A': [blank, null, 06 04 2 P lower left corner]
'B': [blank, null, 06 04 2 P lower right corner]
'C': [blank, null, 06 04 2 P upper right corner]
'D': [blank, null, 06 04 2 P upper left corner]
'3': [blank, null, 2P vertical, 3G]
'_': [blank, null, 3P horizontal]
'\': [blank, null, 3P vertical]
'A': [blank, null, 2P lower left corner]
'B': [blank, null, 3P lower right corner]
'C': [blank, null, 3P upper right]
'D': [blank, null, 3P upper left]
upperleft: [-1, 9]
map: |
D_________C
Expand All @@ -132,6 +132,7 @@ world:
# ███████ ██ █ ██ ███████ ██████ ██ ████ ██
# ██ ██ ███ ██ ██ ██ ██ ██ ██ ██ ██
# ███████ ███ ███ ██ ██ ██ ██ ██ ██
stepsPerTick: 1000
robots:
- name: base
dir: east
Expand Down Expand Up @@ -198,109 +199,184 @@ robots:
#################
## HORIZONTAL ##
#################
- name: 03 00 1 P horizontal wall
- name: 1P horizontal
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 P horizontal wall
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="horizontal wall", room=1]);
m
- name: 2P horizontal
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 P horizontal wall
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="horizontal wall", room=2]);
m
- name: 3P horizontal
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="horizontal wall", room=3]);
m
#################
## VERTICAL ##
#################
- name: 03 00 1 P vertical wall
- name: 1P vertical
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 P vertical wall
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="vertical wall", room=1]);
m
- name: 2P vertical
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 P vertical wall
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="vertical wall", room=2]);
m
- name: 3P vertical
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="vertical wall", room=3]);
m
#################
## CORNERS ##
#################
# the order is:
# upleft upright
# up left up right
# D+----+C
# | |
# | |
# A+----+B
# lowleft lowright
# low left low right
#########
## A ##
#########
- name: 03 00 1 P lower left corner
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 P lower left corner
- name: 2P lower left corner
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 P lower left corner
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="lower left corner", room=3]);
m
#########
## B ##
#########
- name: 03 00 1 P lower right corner
- name: 1P lower right corner
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 P lower right corner
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="lower right corner", room=1]);
m
- name: 2P lower right corner
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 P lower right corner
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="lower right corner", room=2]);
m
- name: 3P lower right corner
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="lower right corner", room=3]);
m
#########
## C ##
#########
- name: 03 00 1 P upper right corner
- name: 1P upper right
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 P upper right corner
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="upper right corner", room=1]);
m
- name: 2P upper right
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 P upper right corner
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="upper right corner", room=2]);
m
- name: 3P upper right
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="upper right corner", room=3]);
m
#########
## D ##
#########
- name: 03 00 1 P upper left corner
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 P upper left corner
- name: 2P upper left
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 P upper left corner
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="upper left corner", room=2]);
m
- name: 3P upper left
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="upper left corner", room=3]);
m
#################
## SEPARATORS ##
#################
# 1
- name: 03 00 1 S down and horizontal wall
- name: 1S down and horizontal
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 03 00 1 S up and horizontal wall
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="S", entity="down and horizontal wall", room=1]);
m
- name: 1S up and horizontal
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="S", entity="up and horizontal wall", room=1]);
m
# 2
- name: 07 01 2 S left and vertical wall
- name: 1S left and vertical
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 S up and horizontal wall
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="S", entity="left and vertical wall", room=2]);
m
- name: 2S up and horizontal
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="S", entity="up and horizontal wall", room=2]);
m
# 3
- name: 06 04 2 S left and vertical wall
- name: 3S left and vertical
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 S down and horizontal wall
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="S", entity="left and vertical wall", room=3]);
m
- name: 3S down and horizontal
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="S", entity="down and horizontal wall", room=3]);
m
#################
## GATES ##
#################
Expand All @@ -320,15 +396,27 @@ robots:
#################
## GARDENERS ##
#################
- name: 03 00 1 P flower
- name: 1P flower
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 07 01 2 P flower
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="flower", room=1]);
m
- name: 2P flower
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
- name: 06 04 2 P flower
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="flower", room=2]);
m
- name: 3P flower
system: true
program: run "scenarios/Tutorials/move_surveil.sw"
program: |
def main = \a. return noop end
m <- instant (run "scenarios/Tutorials/move_surveil.sw";
main [action="P", entity="flower", room=3]);
m
entities:
- name: Win
display:
Expand Down
Loading

0 comments on commit 3ff432a

Please sign in to comment.