Shakey's Language
Section: Robots, Real and Imagined
...Subsection: Shakey's Language
Shakey understands the following six commands:
- step: When Shakey executes a step instruction, he
moves forward one square on his grid, continuing to face in the same
direction as before. Shakey's program will terminate with a run-time
error if he is ever directed to step into a wall. He may occupy the
same square as an item.
- left: Shakey executes a left instruction by
pivoting 90 degrees to the left, remaining on the same square.
- right: Shakey executes a right instruction by
pivoting 90 degrees to the right, remaining on the same square.
- pickup: Shakey picks up an item from the square he is
standing on. If he executes a pickup instruction and the square
he is standing on does not contain an item, then his program
terminates with a run-time error.
- drop: Shakey places one item on the currently occupied
square. If he is not carrying any items, or if the current square
already contains an item, then his program terminates with a run-time
error.
- home: Shakey moves directly to his home position. He
does not pass go... he does not collect 200 dollars. (Ordinarily,
Shakey's home position is in the upper left hand corner of his grid,
facing north.)
There is no limit to the number of items that Shakey can carry at one
time.
These six commands constitute the core of Shakey's language. Later,
you will see how to extend the language by using these six commands as
building blocks. Because they form the foundation of the language,
they are sometimes called primitives.
Suzanne Menzel; menzel@cs.indiana.edu