The name PILOT is an acronym, and stands for Programmed Instruction, Learning, Or Teaching. Like its younger sibling LOGO, it was an early foray into the technology of computer assisted instruction (CAI).
A line of PILOT code contains (from left to right) the following syntax elements:
- an optional label
- a command letter
- an optional Y (for yes) or N (for no)
- an optional conditional expression in parentheses
- a colon (":")
- an operand, or multiple operands delimited by commas.
A label can also be alone in a line, not followed by other code. The syntax for a label is an asterisk followed by an identifier (alphanumeric string with alphabetic initial character).
The following commands are used in "core PILOT". Lines beginning with "R:" indicate a remark (or a comment) explaining the code that follows.
Accept input into "accept buffer".
R:Next line of input replaces current contents of accept buffer
R:Next line of input replaces accept buffer, and string variable 'FREE'
R:Next 3 lines of input assigned to string variables 'X', 'Y' and 'Z'
R:Numeric input assigned to numeric variable "Q"
Compute and assign numeric value.
R:Assign arithmetic mean of #X and #Y to #AM
Most PILOT implementations have only integer arithmetic, and no arrays.
Dimension an array, on some implementations.
End (return from) subroutine or (if outside of a subroutine) abort program. Always used without any operand.
Jump to label.
Match the accept buffer against string variables or string literals.
R:Search accept buffer for "TRUTH", the value of $MEXICO and "YOUTH", in that order
The first match string (if any) that is a substring of the accept buffer is assigned to the special variable $MATCH. The buffer characters left of the first match are assigned to $LEFT, and the characters on the right are assigned to $RIGHT.
The match flag is set to 'yes' or 'no', depending on whether a match is made. Any statement that has a Y following the command letter is processed only if the match flag is set. Statements with N are processed only if the flag is not set.
Equivalent to TN: (type if last match unsuccessful)
The operand of R: is a comment, and therefore not processed.
'Type' operand as output.
Full article ▸