RoBOTL

Defining a World


Once one learns how to define and create robots, and one knows how to tell them what to do, it's time to give them a world to play in. A world consists of World Entities each of which is a collection of one or more World Objects. During execution, one can use the place control statement to place an entity at a specified location in the world. More than one copy of entity can be placed in the world.

To define a world, a WorldEntity block must be given in the define block. This will define a entity that can contain the following objects:


Example:

In our sample world, we show a world as it would be created by the following world definition:

define
{
   WorldEntity sample_world
   {
      beeper at 13,10 = 1;
      beeper at 7,4;
      block at 3,3;
      wall from 7,6 north for 6;
      wall from 9,6 east for 8;
   }
}
execute
{
   place sample_world at 0,0;
   new basic_bot kathy at 0,0;
   tell kathy:
   {
      Move 1;
      TurnOff;
   }
}

Go to Next Section of the RoBOTL Reference Guide:
You can also go:

Created on 19 June 1995
Last revised 22 January 1997
Copyright ©1995,1996,1997 Walter S. Ching, n1hbr@ma.ultranet.com