Stuck in a rut with Basic on your Commodore 64? Try Pilot for a new direction and fresh approaches in C64 programming, says Bryan Skinner.
Pilot In Command
Stuck in a rut with Basic on your Commodore 64? Try Pilot for a new direction and fresh approaches in C64 programming, says Bryan Skinner
Pilot-Plus/64 is a language interpreter for the Commodore 64. The Basic supplied on the C64 is pretty poor, but there are extensions on the market. You can buy well-known languages such as Pascal, Forth and Lisp and Comal (issue 77) but Pilot is relatively little-known.
Documentation
Unfortunately, theres more to the language than can be adequately explained and demonstrated in a narrow, 31-page booklet. This is one area where the booklet falls down - not enough to hack in. That said, the details of the commands are just about adequate for someone coming from Basic. There are a couple of demonstration programs on the surprisingly short tape, and details for backing up to disk are given.
Features
Pilot is quite an easy language to learn and to get to grips with, and this version can even make use of the C64's sound. Like CBM Basic there are no advanced graphics commands but since POKE is supported, and because you can call Basic from Pilot and vice versa, you could splice in some Basic sprite routines to be called from within a Pilot program.
As with Basic, Pilot needs line numbers, and the editing commands are many and varied: there's a full screen editor, and commands like RENUMBER (new, old, increment), DELETE (range), NEW, LIST and SAVE, PLIST lists the current program to printer, FIND finds and lists all lines containing the characters given and GOTO (label) and RUN (label) execute a program from a procedure label, not a line number. To polish off these tasty toolkit commands there's even AUTO for automatic line numbering in selected increments and VERIFY for validation of saved programs. All in all an impressive range of utilities to gladden the heart of many a C64 programmer.
But the resemblance between Basic and Pilot ends there. A Pilot program bears little relation to its Basic equivalent. Pilot-64 uses a system of what are described in the manual as 'op-codes' which are followed by a semi-colon and which can be modified by a following letter. For example, r: is the equivalent to REM, a: means more or less the same as INPUT, t: means PRINT and so on.
In addition, there are some very useful constructs which would take more than a few lines of Basic to emulate. For example, - 'm:dog!cat!horse!mouse' attempts to match the contents of the 'answer buffer' with each entry in the list. If a match is found, the code 'ty:You're right' will display the message following the colon, and translates as 'if the match flag is set, print the following message'. The jump command (j:) can be modified to force a jump to the last accept statement, the last label encountered, the next match statement or the next problem statement. Procedures are supported and are defined by an asterisk and a label (see Figure 1). Figure 2 shows some of the commands available.
Modifiers are specific to commands, th: suppresses carriage return after text is printed, just like the semicolon at the end of a PRINT statement in Basic. tr: PRINTs text in reverse field, tn: displays text if the match flag isn't set, as: accepts a single key press and so on. The screen handling command can be modified to clear the screen (:sc), move the cursor up (:su) etc. There's s@ for PRINT@ or LOCATE, and a graphics mode whereby the screen is treated in double density (80 x 50) and commands for setting, unsetting and testing points are provided. u: (use) calls a subroutine, and the 'b' modifier specifies a subroutine in Basic. SYS 32768 returns control to Pilot. It's surprising how powerful the use of a set of commands and modifiers can be made.
Pilot supports all the data types of CBM Basic - variables include real integer, string and array. Variable names can be of any length, but unfortunately, only the first two characters are significant. You can use string variables just as in Basic, e.g. INPUT A$ becomes a:$a$. There are reserved variable names - ti (the clock), ti$ (the clock in HHMMSS format), aa$ (holds the user's last input); aa% (a useful one this) logs the number of times the last question was answered. This underlines Pilot's main use as a vehicle for the development of learning packages, though complex programs can be written quite easily.
To make sounds you must first set up the SID chip with ps: which is the POKE command redirected by the SID modifier to set up other sound characteristics like attack/decay, sustain/release and so on. The sound effects command is passed three arguments, as in fx:1,440,60 which plays a sawtooth tone in voice 1 for one second.
However, where Pilot really scores is in its simplicity. For programs of the question and answer variety I know of no equal. The built-in features make programming a doddle. You can even use wildcards in the arguments for match, so having accepted (INPUT) an answer you can use m:p*t to test for 'pit', 'pot', 'pat' and so forth. m:Pter&wolf will test for the two words in sequence somewhere in the input buffer, and there are many other variations.
Verdict
Pilot lends itself especially to developing computer-assisted learning (CAL) packages, but can be used to develop complex programs. The facilities would make it an excellent method of coding adventure programs, for example. It's quite easy to learn and to use, even if the documentation's a bit sparse.
There's far more to the package than we've room here to describe, and I recommend it wholeheartedly.
Report Card
Features 5/5
Documentation 2/5
Performance 4/5
Overall value 4/5