home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 128 9
/
q09.d81
/
t.cybertank
< prev
next >
Wrap
Text File
|
2022-08-28
|
17KB
|
337 lines
C Y B E R T A N K
by Jon Mattson
CYBERTANK is a simulation of future warfare, in a time when the
soldiers are computer-controlled mechanical monster-tanks, and the generals
are top military programmers. That sounds simple enough at first, but
trying to actually define what CYBERTANK IS can be much trickier: part game,
part educational experience, part logic puzzle. I prefer the last
definition myself, since your ultimate goal is to piece together the
"perfect" program - a puzzle of sorts. But you may come up with other
definitions while cursing the computer screen...
Note that you need have no previous programming experience to have fun
with CYBERTANK. It is somewhat self-teaching, and, in any event, the
language it uses is unique. In fact, CYBERTANK is a very good way to teach
yourself the rudiments of logical thinking in any programming language.
When you first run the program, a title screen will appear and various
routines and graphics will be loaded. You will quickly find yourself in the
Command Processor, which is where you will do your coding. It is split into
three distinct windows:
The large top List Window normally displays a partial (12 line)
listing of your current program. Of course, it will be empty at first,
since no program is in memory. When it does contain a program longer than
12 lines, you can scroll up and down through the list at almost any time
with the CRSR UP/DOWN keys (either set). Please remember this, as it is the
only option which is not normally listed on the screen.
The central one-line window is the Command Line. This is where you
will enter your commands; in fact, you'll notice a flashing cursor there
waiting for you.
The large bottom Help Window always shows the options currently
available to you. It is "case sensitive" and will change according to your
needs at the time. Virtually all commands are entered with 1 or 2 letter
codes to make typing easier, although a few may also prompt you for numeric
input.
For the moment, press ! to END your current (empty) program. You will
now be at the Main Menu, and the Command Line will inform you that it is
waiting for instructions. Examining the Help Window, you will see 7 options:
COMMAND PROCESSOR: This simply takes you back into the section previously
described, where you may add lines to the end of your current program.
INSERT COMMAND: This option and its counterpart, below, allow you to edit
a program in memory. You will be prompted for a command number at which to
make the Insertion - remember that you can scroll through the listing with
the cursor keys to check anything you need to know. The listing will then
shift to display the target area - the lines just before and just after the
insertion point. You will briefly enter the CP section to type in the
Inserted command. Note that Insert automatically updates any JUMP commands
and the like, so you need not worry that your change will wreak havoc with
program logic. For this reason, always remember to base any Inserted JUMPs
on the listing you actually see at the moment - not on what it will end up
being. Just do things in the easiest way, and the CP will take care of the
rest.
DELETE COMMAND: You will be prompted for a command number - which will
then vanish. Again, any JUMPs and the like will automatically be updated.
JUMPs to a Deleted line will be shifted to the line following it, so be
careful that this still makes sense.
SAVE PROGRAM: You will be prompted for a unique 3-digit "pass code", which
will be used to Save the program in memory to disk. Avoid using '999', as
the included sample uses this code. Remember that it's not a wise idea to
save anything to your LOADSTAR disk: any other disk with at least 9 free
blocks per program will do.
NEW PROGRAM: This will give you two options: start a New program from
scratch or Load one from disk. In the latter case, you will have to enter
the program's 3-digit "pass code". Once the program is Loaded into memory,
you will automatically be moved to the CP mode to examine it. If you want to
examine a sample program, pick this option and enter '999' for the "pass
code". That will Load the sample included with CYBERTANK, which we'll talk
about in greater detail later.
FIELD TEST: This allows you to enter the Combat Simulator and test out
your masterpiece. We'll talk more about this later, too. QUIT: This will
exit CYBERTANK and return you to LOADSTAR if the disk is in the drive.
Now, let's go back into the CP and take a closer look at the many
commands available to you. You should get used to three conventions first:
1. Directions are always given with a digit 'n' from 0 to 7, with 0 being
north, 1 being northeast, and so on.
2. A special 'box' has been set aside to hold any single number you want
the tank to remember. This 'box' is called the HOLDER and is represented by
H. If you are a programmer, think of H as a standard variable which can
hold numbers from 0 to 255. If you aren't, just think of it as a box which
can hold one number at a time so that you can examine it later.
3. There will be times when you will want to keep track of how many times
something has been done. Your tank has two COUNTERS - C1 and C2 - for this
purpose. Several commands allow you to manipulate these COUNTERS
individually, as explained below.
Now for the commands:
END: This ENDs whatever mode you are currently in. In the CP, it returns
you to the Main Menu. In a Field Test, it ENDs the current program and puts
you into Direct Mode (see below). In Direct Mode, it switches control back
to the program, either where it left off from a QUERY or at the beginning
from an END. This sounds complicated but is really quite simple in
practice, as you'll soon see.
IF: This sets up a decision making sequence and must always be followed by
a Condition (see below). When your tank encounters this command, it will
try to decide if the condition is true or not. If so, it will perform
whatever instructions follow in the IF... sequence, until it hits an END IF
(see below). If not, it will skip the whole sequence, jumping down in the
program past the END IF. To make these sequences easier to pick out in the
program, the CP indents all commands following the IF and uses a different
text color, until the sequence is finished. An example will be given later,
where it will make more sense, and should clarify the use of this important
command.
END IF: This command simply denotes the end of an IF... sequence for the
computer. Every IF should have a matching END IF (or END IF w/JUMP); in
fact, the CP will not allow you to exit until this condition is met. Of
course, careless Insertions and Deletions can ruin this pattern and cause
unpredictable results - so be careful.
END IF w/JUMP: This command acts as an END IF, but also automatically
jumps to a new command of your choice instead of the one following the IF
sequence. Think of it as an END IF and JUMP combined into one command, only
performed when the IF sequence is active.
JUMP: As above, this command causes control to move to a new command of
your choice. Think of it as a BASIC GOTO. Of course, unlike the above,
this command is non-conditional and cannot be performed from within an IF
sequence.
FORWARD: Moves the tank forward one "space".
REVERSE: Moves theatank back one "space".
TURN LEFT: Turns the tank left 90 degrees, based on its current facing.
Since the resulting direction will be relative to the tank's original
facing, it is important to keep track of these changes if the tank's course
in important to your program's logic. The HOME command (below) is useful in
this regard.
TURN RIGHT: As above, but turns right 90 degrees.
RANDOM: The tank will pick one of the four movement choices above
randomly. Since this makes keeping track of the tank's current course
difficult, this command should be used sparingly. It is good for shaking up
any pattern the tank seems to be falling into.
FIRE n: This is actually a set of 8 commands: FI