From 506bbb25c26904be541f3db96c6ddbd16f97a37a Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Mon, 22 Jan 2024 16:28:01 -0800 Subject: [PATCH] improve scenario --- .../Testing/1598-detect-entity-change.yaml | 9 ++- .../Testing/1598-watch-wait-instant.yaml | 62 +++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 data/scenarios/Testing/1598-watch-wait-instant.yaml diff --git a/data/scenarios/Testing/1598-detect-entity-change.yaml b/data/scenarios/Testing/1598-detect-entity-change.yaml index 7ea64df32b..0ac6650327 100644 --- a/data/scenarios/Testing/1598-detect-entity-change.yaml +++ b/data/scenarios/Testing/1598-detect-entity-change.yaml @@ -4,6 +4,13 @@ author: Karl Ostmo description: | Ensure that a change to an entity can be observed by a system robot within a single tick. + + In this scenario, the base will first `swap` the + existing `dial (R)`{=entity} with a `dial (G)`{=entity}, + then immediately `swap` again with a `dial (B)`{=entity}. + + The system robot should be able to detect the presence + of the `dial (G)`{=entity} before it is `swap`ped a second time. creative: true seed: 0 objectives: @@ -47,7 +54,7 @@ robots: inventory: - [1, flower] solution: | - wait 8; + wait 2; move; move; swap "dial (G)"; diff --git a/data/scenarios/Testing/1598-watch-wait-instant.yaml b/data/scenarios/Testing/1598-watch-wait-instant.yaml new file mode 100644 index 0000000000..39fd96430e --- /dev/null +++ b/data/scenarios/Testing/1598-watch-wait-instant.yaml @@ -0,0 +1,62 @@ +version: 1 +name: Watch and Wait with Instant +author: Karl Ostmo +description: | + Ensure that the `watch` command does + not introduce a tick delay. +creative: false +seed: 0 +objectives: + - teaser: Has item + goal: + - | + Observe item + condition: | + r <- robotnamed "watchbot"; + as r {ishere "rock"}; + //as r {return false}; +robots: + - name: base + dir: [1, 0] + devices: + - hourglass + - fast grabber + - logger + - treads + inventory: + - [1, flower] + - [1, tree] + - [1, rock] + - name: watchbot + system: true + display: + invisible: false + dir: [1, 0] + program: | + def watchAndWait = + watch down; + wait 1000; + watchAndWait; + end; + + instant watchAndWait; + + inventory: + - [1, flower] +solution: | + move; move; + swap "flower"; + swap "tree"; + swap "rock"; +known: [gold] +world: + dsl: | + {blank} + upperleft: [-1, -1] + offset: false + palette: + '.': [grass, erase] + 'B': [grass, erase, base] + 'c': [grass, gold, watchbot] + map: | + B.c