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

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

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/29/2011 for the course IT 201 taught by Professor K.v.arya during the Spring '11 term at IIT Kanpur.

### Page1 / 3

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

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

View Full Document
Ask a homework question - tutors are online