Class RobotWorldBase
In: karel/robot_world_base.rb
Parent: Object

The the basic features of a world in which the robots move and interact. Other worlds extend this one, such as RobotWorld (in robot_world.rb) and RobotWorld (in tk_robot_world.rb)

Methods

Constants

MOVE_ACTION = 0
TURN_LEFT_ACTION = 1
PICK_BEEPER_ACTION = 2
PUT_BEEPER_ACTION = 3
TURN_OFF_ACTION = 4
CREATE_ACTION = 5
NO_ACTION = -1

Attributes

Beepers  [R] 
EastWestWalls  [R] 
NorthSouthWalls  [R] 

Public Class methods

Create an empty world

Public Instance methods

Fail if there are no robots on the given corner

Fail if there are no robots on the given corner

Return true if there are any beepers on the given corner

Remove all features (walls, beepers) from the world. Robots are not affected

Assert that the given corner is in the world

Return the neighbors of the given robot on the given street. Fails if the robot is not on the given corner when invoked

Save the new state of a robot when necessary

Remove all features (walls, beepers, robots) from the world.

Return true if there are any robots on the given corner

Set the speed at which the simulation runs 0 = no delay 100 = run very slowly

Either (a) pass a number of robots each of which has a run_task method or

       (b) pass a block to be executed when the thread starts

Start all of the known threads and wait until they all complete

Record a robot‘s actions

[Validate]