halt
command to cancel a robot's running program
#392
Labels
C-Low Hanging Fruit
Ideal issue for new contributors.
G-Robots
An issue having to do with robots.
L-Commands
Built-in commands (e.g. move, try, if, ...) in the Swarm language.
S-Nice to have
The bug fix or feature would be nice but doesn't currently have much negative impact.
Z-Feature
A new feature to be added to the game.
Is your feature request related to a problem? Please describe.
Robots can be reprogrammed or salvaged when they are done; but currently there is no way to halt a robot's running program in the middle. This is annoying especially in the case of robots set up to do something forever in an infinite loop. If you messed up the program, or you just decide that you want to do something else now, there's currently no way to stop a robot in an infinite loop.
Describe the solution you'd like
There should be some way to explicitly tell a robot to stop its program. Probably you should (1) need an explicit reference to the robot and (2) be physically close the robot. (If you want to be able to tell robots to halt from far away, well, you can program that yourself once we have #94 .) For example, maybe it can be as simple as a new primitive
halt : robot -> cmd ()
which tells the given robot to halt if it is on the same cell as (or maybe within Manhattan distance 1 of) the robot executing thehalt
instruction.Describe alternatives you've considered
I suppose an alternative would be to just say "tough luck, if you wanted to be able to cancel a robot program then you should have programmed that in from the beginning", with some kind of
cancellable_forever
function that has some built-in polling to see whether it should quit or keep going. But that would be pretty annoying. No one can plan perfectly for the future.The text was updated successfully, but these errors were encountered: