ENVIRONMENT :
A flat surface with a "floor" of relatively uniform color. This color can be either relatively light or relatively dark. Additionally, there is a boundary or "warning track" consisting of a band of color at the opposite end of the brightness spectrum from the floor (dark-on-light or light-on-dark).
GOAL :
"Freely" move about but remaining within the bounds of the environment.
DETAILS :
One way in which a robot to sense its "location" is to use the concept of a "warning track" -- think of a lawn mowing robot that senses a buried wire. That is, the robot moves about the environment until it senses that it has encountered the warning track. At that point the robot would perform some sort of response which would ensure that the robot remains within the boundaries of its environment.
For this program, you will be creating a boundary detecting robot using the light sensor. For original testing purposes, you may use your Test Pad and you may assume that the environment has a light (white) floor with a dark (black) warning track. However, your finished code should allow for the environment to have the opposite configuration. That is, I might put some light masking tape on a dark table and use it as a larger testing area (probably with an irregular shape).
There are at least three ways in which your robot can decide whether it is avoiding a dark warning track or a light warning track.