A Shakey program contains a sequence of Shakey commands. When a Shakey program is run, he performs each command, one after the other, in the order given.
When you use the programming environment to construct your program, the text window will display the program that you are creating. You do not have to actually type each program statement yourself. Thus, you do not have to be overly concerned about the precise syntax of Shakey's language. However, you will see the text of your program and you should be able to recognize the different statements and know what they do.
Here is the syntax of each Shakey command:
command-name();
The trailing punctuation after the command name is required, just as the period must appear at the end of an English sentence.
For example, the following sequence of instructions could be part of a Shakey program.
step(); left(); drop();
All of the statements that comprise the program are surrounded by curly braces, { and }, and there is a header to the program of the form:
function main()
Here is an example of a complete Shakey program that will cause him to turn right, take two steps, drop an item, and then return to his original position:
function main() {
right();
step();
step();
drop();
right();
right();
step();
step();
left();
}