Boolean Functions
RoBOTL
Boolean Functions
A boolean function is one that has one of only two possible values:
true or false.
A boolean function is an operation that returns a boolean value.
In RoBOTL, a boolean value of true is given the integer value of 1.
False is given the integer value of 0.
RoBOTL supports seven boolean functions which allow the detection of
conditions that may
result in an error if ignored. These functions are:
- FrontIsClear
True if the square immediately in front the robot does
not contain a block or another robot.
This does not provide any information about beepers.
If true then a Move 1; instruction
could be executed safely.
- LeftIsClear
- RightIsClear
Same as FrontIsClear except for the square immediately to the left
or right of the robot.
If true and the robot is first rotated in that direction
then a Move 1; instruction
could be executed safely.
- FacingNorth
- FacingSouth
- FacingEast
- FacingWest
True if the robot is currently facing in the direction indicated.
One and only one of
these four boolean functions is true at any point in the program.
Instructions that use Boolean Expressions:
See Also:
You can also go:
Created on 19 June 1995
Last revised 20 August 1996
Copyright ©1995,1996 Walter S. Ching, n1hbr@ma.ultranet.com