Objective
The tank language will look very similar to Logo if you're
familar with it. The object of the language is not to provide
a sophsticated programming language so that the genius programmers
can wreak unstoppable mechanical havok on their opponents. The
goal is to create a language so simple that anyone could program
a tank capable of standing a chance in the arena.
This means that there are no complicated gramatical structures.
We're not trying to make a language that requires a text book
to figure out. Just something, that with a little time, can
be used to create a superior tank. You give it a mind; it uses
it to kill.
What does it look like?
The basic structure of a single command is simple. You
call the command passing in a list of parameters. These
parameters can either be variables or literals. The command
will return a list of out puts that are stored into variables.
return1, return2, ... = command(param1, param2, ... )
Commands will be grouped into labeled sections. This
allows the user of a GOTO command that can jump to
another label in the tanks programmings. Here is a basic
example written in psuedo-code. When the tank language
is finalized upon, this will be updated to be real code.
START:
numOfOpponents = ping()
areOpponents = compare('>', numOfOpponents, '0')
if(areOpponents, 'ATTACK', 'MOVE')
ATTACK:
bearing, distance = locate('0')
turn(bearing);
fire();
goto('START')
MOVE:
turn('45')
move('1')
goto('START')
How is it stored?
For the purposes of storing, the language will be in an XML file.
The above tank commands in the START label will look similar to this:
<label name="START">
<command name="ping">
<return name="numOfOpponents">
</command>
<command name="compare">
<param value="'>'">
<param value="numOfOpponents">
<param value="'0'">
<return name="areOpponents">
</command>
<command name="if">
<param value="areOpponents">
<param value="'ATTACK'">
<param value="'MOVE'">
</command>
</label>
...