IsLikeA definition
RoBOTL
IsLikeA definition
IsLikeA old_type ;
To define a new robot, you must use the
IsLikeA
statement as the first statement in the
NewRobotType
definition. One is never used without the other.
This defines on what robot type (old_type) the new robot type
will be based.
The IsLikeA definition can also be specified using
is_like_a.
Example:
define
{
NewRobotType another_bot
{
IsLikeA basic_bot;
}
}
execute
{
new another_bot karel at 1,1;
tell karel:
{
if (FrontIsClear) Move 1;
TurnOff;
}
}
Other definitions:
You can also go:
Created on 19 June 1995
Last revised 20 August 1996
Copyright ©1995,1996 Walter S. Ching, n1hbr@ma.ultranet.com