-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use built-in portal functionality for Hackman scenario (#1651)
Previously, the logic to wrap horizontally was hand-coded, both for the player (using a dedicated monitor robot) and for ghosts (who, as system robots, implemented the teleportation themselves). Now that we can use built-in portal functionality (#1356), no custom logic is needed to handle the teleportation. A (much-simplified) monitor robot still observes the base robot to award the hidden "World wrap" goal. ## Demo scripts/play.sh -i data/scenarios/Challenges/hackman.yaml --autoplay --speed 6
- Loading branch information
Showing
5 changed files
with
73 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* Algorithm: | ||
If, at any point, the base is more than two cells from its previous location, | ||
it must have teleported. | ||
*/ | ||
|
||
def abs = \n. if (n<0) {-n} {n} end; | ||
|
||
def getBasePos = | ||
as base {whereami}; | ||
end; | ||
|
||
def go = \lastBasePos. | ||
wait 1; | ||
curBasePos <- getBasePos; | ||
let deltaX = abs(fst curBasePos - fst lastBasePos) in | ||
if (deltaX > 1) { | ||
create "bit (0)"; | ||
} {go curBasePos}; | ||
end; | ||
|
||
curBasePos <- getBasePos; | ||
go curBasePos; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters