
This page is devoted to giving the information which doesn't really
fall into any of the other sections of the reference guide.
The RoBOTL Map is 20x20 (by default, the size can change by use of the
DefineMapSize statement), and can
hold robots, beepers, blocks, and walls.
The map is broken into squares, each of which are uniquely identified
by the use of Coordinates.
Names are defined as a letter ("a"-"z","A"-"Z") followed by
zero to thirty letters, numbers ("0"-"9"), and
underscores ("_"). For example: Pete_Bot,
Q, and smart_bot_1 are all valid
names. Invalid names include 1bot,
smarty!, and _a-bot.
Names can NOT be one of the RoBOTL Reserved Words.
Coordinates are simply an ordered pair ( X, Y ) that uniquely identifies a
square on the RoBOTL map. The lower-left square is ( 0, 0 ), and (by
default) the upper-right square is ( 19, 19 ). See a sample map for an example.
Each robot comes equipped with a magnetic compass which tells the
robot which direction it is facing. Initially, the robot is created
facing eastward (arbitrarily chosen), and the robot can only turn in
90° increments, so the only valid directions are the standard
compass directions: North, East, South, West.
There are a number of keywords which are used by RoBOTL, and
therefore, can't be used as a Name. That list
is:
- all
- and
- as
- at
- beeper
- beepersinbag
- beepersonfloor
- block
- define
- defineglobalinteger
- defineinteger
- defineinitialbeepers
- definemapsize
- definenewinstruction
- do
- east
- else
- execute
- facingeast
- facingnorth
- facingsouth
- facingwest
- for
- from
- frontisclear
- if
- islikea
- Iterate
- kill
- leftisclear
- mapsize
- move
- new
- north
- newrobottype
- not
- or
- pickbeeper
- place
- putbeeper
- remove
- rightisclear
- south
- tell
- times
- turnleft
- turnoff
- turnon
- wall
- west
- while
- worldentity
- xposition
- yposition
You can simply use a single instruction or statement without doing
anything special. (ie: 'iterate 3 times turnleft;' is
perfectly fine.) However, when you want to perform a set of
instructions or statements that are related, you put them within a set
of curly braces ("{" and "}".) For instance:
-
When telling a robot to do something, you wouldn't use:
-
tell robot: turnleft;
tell robot: move 1;
You'd group the related instructions together like this:
-
tell robot: {
turnleft;
move 1;
}
While comments are not specified in the RoBOTL grammar, the RoBOTL
JAVA Applet (1.0) does support single and multi-line comments, using
the standard C++ convention:
// The double-slash is used for a single line comment.
/* The slash-star-star-slash method is used for multiple
line comments. */
- Any parts of a world which fall outside of the map area will be
ignored.
- If there is a conflict on a square (i.e., a beeper is to be placed
in a square with a block in it), the first placed item wins.
- Placing beepers is additive. (i.e., if a beeper is placed on a
square which already has a beeper, the square then has two beepers.)
- Walls are placed a block at a time, and follow the rules for
placing a block.
This guide is not great to look at under text-only browsers. Sorry.
Since you need a graphical browser for the applet, we figured you'd be
using it for the reference guide.
Document Last Revised: Tuesday December 16th, 1997 at 2:03am
Copyright ©1997
Worcester Polytechnic Institute
Page Written by: Theo Van
Dinter (felicity@kluge.net)