[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The "Robotwar" assembler?
On 21 Apr 1999 16:04:02 GMT, Nele Abels-Ludwig
<Abels@stud-mailer.uni-marburg.de> wrote:
>
>Hello, you good people :)
>
> With much interest, I have looked at the ancient Apple ][ game
>"Robotwars", where you had to write an efficient control program for a
>virtual fighting robot. The commands include moving, scanning and
>firing. I have studied the source examples and the "assembler" seems to
>be pretty straightforward, but does anybody have a concise manual for
>the robot-commands? Or *gosh* a game manual?
Yep. I've still got the Robot War manual, but this quick summary is
probably all you'll need:
The valid commands are:
TO stores a value in a register
(eg: 240 TO A or 240 TO A TO B)
IF compare 2 values and alter program sequence
(eg: IF RADAR<0 GOSUB FIRE)
GOTO Go to a label
(eg: GOTO SCAN)
GOSUB Execute a subroutine
ENDSUB Return from a subroutine
+ - * / arithmetic functions
(eg: 240-A*2 TO B)
Numbers can only be integers between -1024 and 1024.
The allowed conditions signs are: = < >
The registers are:
A through W and Z - General memory registers
X - Stores horizontal position of robot (0-256)
Y - Stores vertical position of robot (0-256)
AIM - Angle of gun in degrees (0-359) 0 is North
RADAR
Storing a number here (0-359) sends a beam out in the given direction.
The register then returns either a positive value (distance to a wall)
or negative value (distance to an enemy robot).
SHOT
Fires the gun in the direction AIMed. Setting a value in the SHOT
register sets a timer for the distance the shell will travel. The gun
takes a while to cool down and can not be fired until the value of
SHOT returns to 0.
DAMAGE
Registers damage your robot has taken. DAMAGE starts at 100 and
reduces to 0 (dead).
SPEEDX
Controls and monitors the speed in the X direction. Values can be
between -255 and 255.
SPEEDY
Controls and monitors the speed in the Y direction. (-255 to 255)
RANDOM
Generates a random number between 0 and the number stored each time
the register is accessed.
INDEX/DATA
Storing a number from 0 to 34 in the INDEX register causes the
corresponding register to be used whenever the DATA register is
referenced.
The code lines must be indented. Labels are not indented.
Some examples of illegal instructions:
A*(B+C) TO D No parentheses are allowed.
20.35 TO E Only integers can be used.
-A TO B You must use 0 - A TO B
IF A+B=C*3 GOTO LABEL No arithmetic allowed after = sign
That's about it.
I can send you a disk image of some of my old creations if you'd like
to see some more code examples.
I'm also keen to pit some of my old "bots" against some that someone
else has created. So I'd be very interested in seeing any robots you
come up with.
Cheers,
Steve Evans