xarel - Xarel the Robot - - - The students of the U of Xp...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 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. Looking from 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 degrees. 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
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

xarel - Xarel the Robot - - - The students of the U of Xp...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online