-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #392 . Adds a command `halt : actor -> cmd unit` which halts the given robot if it is within a distance of 1 (no distance limit for system robots or in creative mode). `halt self` works too. Privileged robots (i.e. system robots, or when in creative mode) can halt any other robot. Unprivileged robots cannot halt system robots.
- Loading branch information
Showing
11 changed files
with
117 additions
and
2 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
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,57 @@ | ||
version: 1 | ||
name: Halting test | ||
creative: false | ||
description: Stop a robot using halt | ||
objectives: | ||
- goal: | ||
- The robot next to you is holding a flower, but is stuck in an | ||
infinite loop. Get the flower! | ||
condition: | | ||
as base {has "flower"} | ||
solution: | | ||
mr <- meet; | ||
case mr (\_. return ()) (\r. halt r; turn west; move; salvage ) | ||
robots: | ||
- name: base | ||
dir: [0,-1] | ||
display: | ||
char: Ω | ||
attr: robot | ||
devices: | ||
- compass | ||
- dictionary | ||
- grabber | ||
- toolkit | ||
- logger | ||
- tank treads | ||
- antenna | ||
- ADT calculator | ||
- halting oracle | ||
- name: infinitebot | ||
dir: [0,1] | ||
display: | ||
invisible: false | ||
devices: | ||
- strange loop | ||
- dictionary | ||
- treads | ||
inventory: | ||
- [1, flower] | ||
program: | | ||
def forever = \c. c ; forever c end; | ||
forever ( turn right ) | ||
world: | ||
default: [blank] | ||
palette: | ||
'Ω': [grass, null, base] | ||
'^': [grass, null, infinitebot] | ||
'.': [grass] | ||
upperleft: [0, 0] | ||
map: | | ||
......... | ||
......... | ||
......... | ||
...^Ω.... | ||
......... | ||
......... | ||
......... |
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 |
---|---|---|
|
@@ -77,6 +77,7 @@ | |
"view" | ||
"appear" | ||
"create" | ||
"halt" | ||
"time" | ||
"scout" | ||
"whereami" | ||
|
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
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