Valid Operators in RoBOTL (from lowest to highest order of precedence):
Operator Type | Operator | Example(s) |
---|---|---|
Boolean OR | ||, or | variable1 || variable1 |
Boolean AND | &&, and | variable1 and variable2 |
Relation | !=, == | 1 != 2 |
Less-than/Greater-than | <, >, <=,>= | 3 > 2 |
Additional | +, - | 3 + 2 |
Multiplicitive | *, / | 8 / 4 |
Not and Sign | not, !, +, - | -2 |
Variables occur in both "execute" statements and robot instructions (also called global variables), or in just robot instructions (also called local variables.)
Variables can be used only after being created. You can use the following commands to create a variable for use:
Function Name | Description | Where Available |
---|---|---|
BeepersInBag | Returns the number of beepers that the robot has in its beeper bag. | robot instructions |
BeepersOnFloor | Returns the number of beepers on the floor in the square the robot is occupying. | robot instructions |
XPosition | Returns the current X Position of the robot. | robot instructions |
YPosition | Returns the current Y Position of the robot. | robot instructions |
MapSize | Returns the order (# of columns/rows) of the current map. | global |
Function Name | Description |
---|---|
FrontIsClear/LeftIsClear/RightIsClear | Returns false if there is an obsticle (robot or wall) in front/to the left/to the right of the robot. |
FacingNorth/FacingSouth/FacingEast/FacingWest | Returns true if the robot is facing the declared direction. |