![]() Karel cannot respond to a move() command if there is a wall blocking its way. ![]() ![]() ![]() What can Karel do? When Karel is shipped from the factory, it responds to a very small set of commands: Asks Karel to move forward one block. world is always bounded walls along the edges, but the world may have different dimensions depending on the specific problem Karel needs to solve. Karel cannot walk through walls and must instead go around them. The solid lines in the diagram are walls. As described in Rich book, beepers are cones which emit a quiet beeping Karel can only detect a beeper if it is on the same corner. The object in front of Karel is a beeper. 4 3 2 1 1 2 3 4 5 6 Several other components of world can be seen in this example. Here Karel is located at the corner of 1st Street and 1st Avenue, facing east. Karel can only be positioned on corners and must be facing one of the four standard compass directions (north, south, east, west). Preview text KAREL THE ROBOT LEARNS JAVA Eric Roberts Department of Computer Science Stanford University September 2005 2 world world is defined streets running horizontally and avenues running vertically The intersection of a street and an avenue is called a corner.
0 Comments
Leave a Reply. |