Xarel the Robot
----- --- -----
The students of the U of Xp have built a robot out
of legos and motors and sensors and computer chips,
just the kind of thing they usually do.
They call it
Xarel, for `eXperimental kAREL'.
Xarel lives on a 5x5 board of squares.
above, he can face East, South, West, or North in the
square he is in, and he has two commands: `m' to move
forward one square, and `t' to turn clockwise 90
He has a sensor to let him know if he is
facing a board edge, and this is used to turn the `m'
command into a no-operation (nop) if he is asked to
move off the edge of the board.
The board squares have been given coordinates, x and
y, each with values 0, 1, 2, 3, or 4
and Xarel is
said to be in a state `xyd' where x is the x coordi-
nate digit, y the y coordinate digit, and d the
direction Xarel is facing in, E, S, W, or N, which
denote toward increasing x, decreasing y, decreasing
x, or increasing y, respectively.
Thus the board
layout, viewed from above, is