From ba8dae3148bd4236536786aa738ea98a001d21b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondr=CC=8Cej=20S=CC=8Cebek?= Date: Sun, 15 Sep 2024 21:46:43 +0200 Subject: [PATCH] Watch for lodestone --- data/scenarios/Testing/562-lodestone.sw | 14 ++++++++------ data/scenarios/Testing/562-lodestone.yaml | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/data/scenarios/Testing/562-lodestone.sw b/data/scenarios/Testing/562-lodestone.sw index 07c49964b..7ca7cdda3 100644 --- a/data/scenarios/Testing/562-lodestone.sw +++ b/data/scenarios/Testing/562-lodestone.sw @@ -5,8 +5,10 @@ def ifC = \p.\t.\e. if b t e end; -def until = \p.\t. - ifC p t {until p t} +def waitFor = \e.\t. + watch down; + wait 100; + ifC (ishere e) t {waitFor e t} end; def repeat = \c. @@ -29,18 +31,18 @@ end; // get one lodestone build {log "Hey!"; turn north; m2; l <- grab; turn back; m2; place l}; -until (ishere "lodestone") {grab}; +waitFor "lodestone" {grab}; // get two bit (0) build { log "Hi!"; repeat ( log "I am going for a bit"; - turn east; m2; x <- until (ishere "bit (0)") {harvest}; turn back; m2; place x; + turn east; m2; x <- waitFor "bit (0)" {harvest}; turn back; m2; place x; log "I brought a bit"; )}; -until (ishere "bit (0)") {grab}; -until (ishere "bit (0)") {grab}; +waitFor "bit (0)" {grab}; +waitFor "bit (0)" {grab}; make "bit (1)"; make "drill bit" diff --git a/data/scenarios/Testing/562-lodestone.yaml b/data/scenarios/Testing/562-lodestone.yaml index f97f071f7..bbdb6bf5e 100644 --- a/data/scenarios/Testing/562-lodestone.yaml +++ b/data/scenarios/Testing/562-lodestone.yaml @@ -25,6 +25,7 @@ robots: - workbench - 3D printer - branch predictor + - rolex inventory: - [10, drill] - [10, lambda] @@ -37,6 +38,7 @@ robots: - [10, strange loop] - [10, branch predictor] - [10, toolkit] + - [10, rolex] - [0, drill bit] - [0, bit (0)] - [0, bit (1)]