From be55b762c920168c8faf104aef2065064e0c67ec Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Sun, 17 Sep 2023 15:24:40 -0700 Subject: [PATCH] Use command to check goal in sheep scenario --- .../_gated-paddock/enclosure-checking.sw | 15 +-------------- .../Ranching/_gated-paddock/update-and-test.sh | 2 +- .../Challenges/Ranching/gated-paddock.yaml | 17 ++--------------- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/data/scenarios/Challenges/Ranching/_gated-paddock/enclosure-checking.sw b/data/scenarios/Challenges/Ranching/_gated-paddock/enclosure-checking.sw index f23c12a26d..9160253a34 100644 --- a/data/scenarios/Challenges/Ranching/_gated-paddock/enclosure-checking.sw +++ b/data/scenarios/Challenges/Ranching/_gated-paddock/enclosure-checking.sw @@ -12,22 +12,9 @@ // The breadcrumb is oriented in case a single-width passage is backtracked // along the opposite wall.) -/** A "gate" is walkable, so we need to supplement the "blocked" check with this function. -Since fences are "unwalkable", they do not need to be mentioned in this function. -*/ -def isFenced = - s <- scan forward; - return ( - case s - (\_. false) - (\x. x == "gate") - ); - end; - def isBlockedOrFenced = b <- blocked; - f <- isFenced; - return (b || f); + return b; end; // Returns true if we've already placed two diff --git a/data/scenarios/Challenges/Ranching/_gated-paddock/update-and-test.sh b/data/scenarios/Challenges/Ranching/_gated-paddock/update-and-test.sh index 5dfd1d2c81..52bcbffea0 100755 --- a/data/scenarios/Challenges/Ranching/_gated-paddock/update-and-test.sh +++ b/data/scenarios/Challenges/Ranching/_gated-paddock/update-and-test.sh @@ -7,4 +7,4 @@ SCENARIO_FILE=$PARENT_DIR/gated-paddock.yaml PROGRAM=$(cat $SCRIPT_DIR/enclosure-checking.sw | sed -e 's/[[:blank:]]\+$//') yq -i '.objectives[0].condition = strenv(PROGRAM) | .objectives[].condition style="literal"' $SCENARIO_FILE -stack run -- --scenario $SCENARIO_FILE --run $SCRIPT_DIR/fence-construction.sw --cheat \ No newline at end of file +stack run --fast -- --scenario $SCENARIO_FILE --run $SCRIPT_DIR/fence-construction.sw --cheat \ No newline at end of file diff --git a/data/scenarios/Challenges/Ranching/gated-paddock.yaml b/data/scenarios/Challenges/Ranching/gated-paddock.yaml index ebf834f36a..d37d1ad18d 100644 --- a/data/scenarios/Challenges/Ranching/gated-paddock.yaml +++ b/data/scenarios/Challenges/Ranching/gated-paddock.yaml @@ -35,22 +35,9 @@ objectives: // The breadcrumb is oriented in case a single-width passage is backtracked // along the opposite wall.) - /** A "gate" is walkable, so we need to supplement the "blocked" check with this function. - Since fences are "unwalkable", they do not need to be mentioned in this function. - */ - def isFenced = - s <- scan forward; - return ( - case s - (\_. false) - (\x. x == "gate") - ); - end; - def isBlockedOrFenced = b <- blocked; - f <- isFenced; - return (b || f); + return b; end; // Returns true if we've already placed two @@ -142,7 +129,7 @@ objectives: create specialDrill; equip specialDrill; - // **NOTE:** System robots can walk on water + // NOTE: System robots can walk on water // so we only need this if we want to // demo the algorithm with a player robot. // create "boat";