Classic Computer Magazine Archive COMPUTE! ISSUE 29 / OCTOBER 1982 / PAGE 116

Turtle PILOT For The Atari

Charles Brannon
Editorial Assistant

Use Program 1, the Turtle PILOT Editor, to enter and edit PILOT programs. Program 2, the Translator, converts your PILOT program into a BASIC program that is ready to RUN. Program 1 requires 32K with a disk, or 24K with a cassette. Program 2 requires 40K with a disk, or 32K with a cassette. By adjusting the MAX variable (line 1410 in Program 1, line 240 in Program 2), you may be able to adapt PILOT to systems with less RAM.

Using Atari Turtle PILOT

Using the Turtle PILOT Editor is like typing in a BASIC program, but there are some important differences. The Editor has 13 commands to help you type in, edit, save, and load PILOT programs (see the Quick Reference Chart). Each command is acknowledged with an "OK" prompt. If you see the "READY" prompt, you've somehow returned to BASIC.

The ADD command is used to enter programs sequentially. Just type "ADD," and you will be prompted with a line number. You can then type in a PILOT line, which will be added to the end of ' your program. For example,

l > T : What is your name?
2 > A : NAME$
3 >

Press RETURN> alone on a line to exit the ADD command. While in the ADD mode, you can't cursor up to change previous lines, so be careful. You must use ADD to add lines to the bottom of your program, but you can use cursor-based editing to change any line already typed. Simple syntax checking is performed. The line must start with a valid PILOT command and must contain a colon.

List, Insert, Delete

LIST is used, as in BASIC, to display the program you are working on. Just type "LIST," and you will be asked for the starting and ending lines to list. "Default" answers are automatically provided, so if you want to list the whole program, just press RETURN twice. Otherwise, type over the default answers. While the program is listing, you can press "ESC" (for Escape) to abort the listing (used like the BREAK key, which is disabled in this program).

LMOD will find and list a specified module. For example, if you have a module named "*TURTLE," just type LMOD, and answer the prompt with "TURTLE" (the asterisk is supplied for you).

If you want to insert a line between two lines, enter "INS" (for INSert), and answer the prompt with the line number at which you wish to insert. The given line and all following lines will be "pushed down, " and the given line will show as "BLANK." You can then LIST the program and cursor up to the blank line and make your addition.

To delete a line from a program, just type in its line number and press RETURN. The program will be automatically renumbered. To delete a range of lines, just type "DEL" and enter the start and end lines of the block of lines you want to delete. Use the NEW command to erase the entire program.

When using LOAD and SAVE, supply the complete filename (either C: or D:name), but don't use the optional three-character extender, as this is supplied automatically by the program. If you have a PILOT program in memory and type LOAD, the Editor will assume you want to append a program to the end of the one in memory. If you don't wish to do this, hit RETURN to exit the LOAD command, enter "NEW," and then type LOAD again.

Disk users will find the "DIR" command very helpful. It displays the directory of drive 1. Used in conjunction with PON, you can have a hardcopy listing of the directory. The PON command "turns on" the hardcopy option. After a PON command, all output will be sent to the printer (assuming you have one attached and turned on). You can use this feature to print listings of your PILOT programs. Use POFF to "de-select" the printer.

You can exit the Editor with either "BYE" or "RUN." The former will simply restore the break key, clear the screen, and return you to BASIC. "RUN" will run the Translator on disk-based systems. Make sure you save the program you're working on before you use "RUN" or "BYE."

Operation of the Translator is very simple. Just answer the filename prompt with the name of your PILOT program (you don't have to type D:). If you are using a cassette, position the tape to read the PILOT program, press PLAY, and answer with "C:". Press RETURN when you hear the beep. The Translator will then read in the PILOT program and start to work on the translation. If you have a cassette, insert a blank tape, rewind it, and press RETURN when you hear two beeps.

Quick Reference Chart

Editor Commands

ADDAdds lines to program from keyboard.
LISTDisplays program.
LMODLists module.
INSInserts line.
DELDeletes range of lines.
NEWErases program.
LOADEnters or appends program from tape or disk.
SAVESaves program to tape or disk.
DIRLists disk directory.
PONSets hardcopy feature.
POFFClears hardcopy feature.
RUNRUNs Translator (disk only).
BYEExits to BASIC.

Turtle PILOT Commands:

T: Type line. Use $ and # to include variables.

A: Accept (ask for) input.

M: Match last accept with list of items separated by commas. Sets Y/N flag.

J:*LABEL Jump to indicated label.

U:*MODULE Use (call, GOSUB) indicated module (subroutine).

E:END Used to stop program or end a module.

C:Compute. Used to calculate variables. Similar to B:

R:Remark. Used to comment your program, like REM in BASIC.

S:Sound x,y x = tone, y = duration. Uses only voice 0. Use B: and SOUND for other effects.

B:line Compile a BASIC line.

* (No colon) Indicates a label.

G:Graphics (see below)

Graphics Subcommands

CLEARClears screen; enters Graphics 7.
TURNTOAPoints turtle to angle A.
TURN ARotates turtle A degrees.
DRAWNMoves turtle N units, leaving a trail.
GONMoves N units without leaving a trail.
PEN ERASESelects drawing color.
PEN DOWNPermits or prevents drawing.
SCREEN APPLE Sets scale of drawing. (See text.)
GOTO X,YGo to absolute coordinate (-79,79; -47,47).
FULLRemoves text window.
MIXEnables text window.
QUITGoes to Graphics 0.

When the Translator is finished, you can use ENTER to read the completed BASIC program into memory. (Use ENTER"C" for cassette or ENTER"D:name.ENT" for disk, where "name" is the name of the program.) The Translator automatically NEWs itself out on completion, so you don't have to worry about the program-merging effect of ENTER. You may want to change the "NEW" on line 390 to "END" while you are typing in and correcting the program. For safety's sake, SAVE a copy of the Translator before you RUN it.

The "BASIC" program which results from your efforts will run as is and will mimic the action of the PILOT program, albeit slower.

A Note On Graphics

This PILOT system was converted from the Apple version published last issue. Since Apple graphics differ from Atari graphics, a few things need to be mentioned. The Apple used high-resolution page one, which permits eight simultaneous colors, while the Atari version uses Graphics 7, a four-color mode with less resolution than the Apple screen. To allow Atari users to enter Apple programs without changes, the SCREEN command can be used in your PILOT program to select the "scale" of points plotted. SCREEN ATARI is the default mode, but if your program includes SCREEN APPLE, all coordinates are "scaled" from Apple coordinates (0-279) to Atari coordinates (0-159). All unimplemented Apple colors are plotted in COLOR 1.