home *** CD-ROM | disk | FTP | other *** search
- 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: FIRE 0, FIRE 1, etc. It
- tells the tank to fire its gun at direction n.
-
- FIRE H: Fire in direction indicated by H.
-
- EXPLODE: This will end your session quickly - but with a lower rating! It
- can sometimes be used to wipe out one last enemy in an otherwise hopeless
- situation or, in Direct Mode, to end the test prematurely.
-
- HOME: Figures out in which direction your home base lies. The information
- can then be used by a special set of Conditions (see below). This command
- also puts the tank's current facing in H: 0 for North, 2 for East, 4 for
- South and 6 for East. This can be useful at times but also wipes out
- whatever you had in H, so be careful. In Direct Mode, this command will also
- print the actual direction of your home base (N, NE, etc.) on the command
- line for a moment so that you can get your bearings.
-
- SCAN: The tank will determine the direction of any potential targets, to
- be used with the Conditions listed below. Of course, not all 'targets' are
- hostile... More on this later. This command also puts the latest target's
- direction in H, which allows you a shortcut method of finding and shooting
- targets: SCAN, then FIRE H. Of course, this is not a particularly
- discriminating method.
-
- FIX DAMAGE: The tank will ATTEMPT to repair up to 10% of the damage it has
- taken. The worse shape its in, the less likely it is that it will succeed.
-
- QUERY: The program will pause and put you in Direct Mode (see below).
- This will continue until you END Direct Mode, at which time the program will
- pick up where it left off.
-
- COUNT1: This simply counts, adding 1 to C1. C2 has a like command. Note
- that a COUNTER 'turns over' at 256, going back to 0.
-
- ZERO COUNTER1: This resets C1, back to 0. C2 has a like command.
-
- PUT COUNTER 1 IN HOLDER: Does just what it says. C2 has a like command.
- This is useful for making several similar actions; for example, to fire in
- all 8 directions: Put C1 in H, Fire H, Count1, then start again if C1 is
- less than 8.
-
- As previously noted, there are also a number of Conditions for use
- with an IF command. These will only appear in the Help Window just after
- the input of an IF, and include:
-
- COUNTER1 =: Checks to see if C1 is equal to a number you specify. If so,
- the IF sequence is performed. C2 has a like command.
-
- HOLDER =: As above, but applies to H.
-
- DAMAGE >=: As above, but applies to the damage the tank has taken in 10%
- increments from 0 to 9. Since you are generally concerned with high damage
- scores, the comparison is a "greater than or equal to" one instead of just
- "equal to". For example, a damage of 5 would trigger a DAMAGE >=3
- Condition.
-
- HOME DIRECTION =: As above, but applies to the current direction of your
- home base. Of course, this decision can only be made properly after a HOME
- command.
-
- OBSTACLE: This Condition will be true when the last move the tank tried to
- perform was unsuccessful. This is a common check and will be used in an
- example later.
-
- TARGET AT n: This is actually a set of 8 Conditions: TARGET AT 0 and so
- on. The Condition will be true when a target lies in direction n. This is
- naturally only useful after a SCAN.
-
- TARGET AT H: As above, but applies to the direction indicated by H.
-
- HIT FROM n: This is actually a set of 8 Conditions: HIT FROM 0, HIT FROM 1
- and so on. This Condition will be true when the tank is struck by an enemy
- in direction n. By combining this check with FIRE n, you can create a tank
- with 'fire only if fired on' orders.
-
- HIT FROM H: As above, but applies to the direction indicated by H.
-
- Phew! Well, you probably won't be able to take this in all at once,
- but you will get used to it in time - and, once you do, you will appreciate
- the versatility the many commands offer. The Help Windows also prevent the
- need for much memorization.
-
- A couple of simple examples are probably in order:
-
- 000 SCAN
- 001 IF TARGET AT H
- 002 FIRE H
- 003 END IF w/JUMP TO 000
- 004 FORWARD
-
- To paraphrase this in plain English: 1. Look around 2. If you notice any
- target, fire at it then go back to step 1... 3. ...otherwise move forward.
- Simple, right? Here's another common programming example:
-
-
- 000 FORWARD
- 001 IF OBSTACLE
- 002 TURN LEFT
- 003 END IF
- 004 JUMP 000
-
- Or, in plain English:
-
- 1. Move forward
- 2. If that didn't work, turn left
- 3. Go back to step 1 and do it again
-
- At this point, you should probably use the New Program command from
- the Main Menu to Load file '999'. Study it carefully and try to see what's
- going on. Then, go back to the Main Menu and try a Field Test to see if
- you're right.
-
- When you enter the Combat Simulator, the List Window will be replaced
- by a view of your tank's surroundings, a computer generated battlefield
- which changes with each test. Your tank sits in the center of the screen,
- just south of 'home base'. There are several types of terrain, and many of
- these are impassable to a computer-controlled CYBERTANK, as you will soon
- discover.
-
- The Command Line will be inactive, except for a notation that your
- program is running. Likewise, the Help Window will be empty except for a
- counter which keeps track of your tank's damage in 10% increments. Keep an
- eye on this: you'll notice that your tank performs less reliably when badly
- damaged, sometimes skipping commands altogether.
-
- As you watch, the tank should kick into action, following its
- programmed instructions. Targets of various types will appear, mostly
- attempting to eliminate your cybernetic marvel, and the battle will begin.
- This will continue until the tank either gets back to home base or is
- destroyed.
-
- As the Command Line indicates, you can 'break into the program' at any
- time by pressing the back arrow. In fact, this will automatically occur
- whenever a QUERY instruction comes up. This puts the tank into Direct Mode,
- and allows you to issue a sub-set of individual commands directly to it, as
- indicated by the Help Window. This is handy for getting it out of a
- situation you hadn't predicted or sending it home. Press ! (END) at any time
- to exit Direct Mode.
-
- On the negative side, the enemy will not sit and wait for you to type
- in instructions. Keep in mind, too, that every Direct command you enter
- will reduce your program's final combat rating. After all, your real goal
- is to create a program which can handle anything thrown at it WITHOUT human
- intervention.
-
- When your tank exits the field, in glory or in pieces, you will be
- given a rating of its performance. This takes into account many factors:
- the number of enemies destroyed and non-Direct commands processed, the
- tank's ultimate fate and so on. It is reduced by over-use of Direct Mode
- and by the destruction of non-hostile targets.
-
- Don't be discouraged by a low rating at first: it takes time to master
- CYBERTANK programming. You may wish to run the same program through more
- than once before altering it, to cancel out the 'luck factor' somewhat -
- especially if you are challenging a friend to a 'duel of cybernauts'.
- Remember, though, that one of your main goals should be to design a program
- which can work around this luck factor. There are no second chances on a
- real battlefield!
-
- A few last hints, tips and things to think about:
-
- 1. You'll quickly discover that not all targets are hostile. In fact, you
- will LOSE points for every android destroyed, since it represents one of
- your own troops! This problem CAN be avoided - but you'll have to figure
- out how yourself.
-
- 2. Getting home after a successful battle can be tricky, but, again, it
- CAN be done without resorting to Direct Mode. You'll also have to decide
- your criteria for making the return trip. After a certain length of time?
- After shooting x enemies? The counters are useful here, but the rest is up
- to you.
-
- 3. Don't look to the sample program to solve these and other puzzles for
- you. It is fairly basic - adequate, but not especially intelligent - and
- designed mainly to give you a jumping off point. As I said before, this is
- a puzzle of sorts, and there's not much point in giving away all the answers
- right away. Besides, this is a puzzle with more than one 'correct
- solution', and its up to you to find the one you like best. When you think
- you have it licked, try challenging an interested friend and see who really
- is the Patton of the CYBERTANK arena!
-
- JM
- **** End of Text ****
-