![]() The robot breaks if the backpack is empty. Intersection this robot currently occupies. Public void putThing() Take something out of the robot's backpack and put it down on the There are no movable things on the current intersection the robot willīreak and not respond to further commands. ![]() Public void pickThing() Attempt to pick up a movable thing from the current intersection. The robot remains on the same Intersection. Public void turnLeft() Turn this robot left by 90 degrees or one quarter turn. The robot can detect whether or not the way is clear In that direction anyway, it will break and no longer respond toĬommands. Or blocks entry to the next intersection. It is possible that something blocks the exit of this intersection Public void move() Move this robot from the intersection it currently numThings - The number of things initially in the Robot's backpack. Int numThings) Construct a new Robot at the given location in the given city with the aDirection - The robot's initial direction. anAvenue - The robot's initial avenue within the city. aStreet - The robot's initial street within the city. Parameters: aCity - The city in which the robot will exist. IColorĭirection aDirection) Construct a new Robot at the given location in the given city Methods inherited from interface becker.robots. ObjectĬlone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait GetCity, getColor, getIcon, keyTyped, notifyObservers, notifyObservers, setColor, setIcon Methods inherited from class becker.robots. Turn this robot left by 90 degrees or one quarter turn. Save a representation of this robot to an output stream. Intersection this robot currently occupies.Īttempt to take a particular kind of thing out of this robot's backpackĪnd put it on the intersection currently occupied by this robot.Īttempt to put down a particular thing on the intersection this Take something out of the robot's backpack and put it down on the Occupies to the next intersection in the direction it is currentlyįacing, leaving it facing the same direction.Īttempt to pick up a movable thing from the current intersection.Īttempt to pick up a particular kind of thing from the intersectionĪttempt to pick up a particular thing from the intersection this ![]() Move this robot from the intersection it currently Make a new thing to place in the Robot's backpack. Instances of the specified kind of thing. How many moves and/or turns does this robot complete in one second?ĭetermine whether this robot is on the same intersection as one or more Return a reference to this robot's intersection. Things, one at a time, that are on the same intersectionĪs this robot and match the provided predicate.Ĭan this robot to move forward to the next intersection safely? Other Robots, one at a time, that are on the same Light objects, one at a time, that are on the same How many of a specific kind of thing are in this robot's backpack? How many things are in this robot's backpack?ĬountThingsInBackpack( IPredicate kindOfThing) This method is called when the robot does something illegal suchĪs trying to move through a wall or picking up a non-existant object.ĭetermine whether this robot is on the same intersection as a thing Robots can also pick up and put down specific kinds of things and determine howĬonstruct a new Robot at the given location in the given cityĬonstruct a new Robot at the given location in the given city with the Themselves and determining if they are beside a specific kind of thing. More advanced features include determining if it is safe to move forward,Įxamining things on the same intersection as ![]() Robot knows which avenue and street it is on and which direction it isįacing. Ninety degrees, pick things up, carry things, and put things down. Robots exist on a rectangular grid of roads and can move, turn left Public class Robot extends Sim implements ILabel, IColor SUMMARY: NESTED | FIELD | CONSTR | METHODĬlass Robot All Implemented Interfaces: IColor, ILabel Direct Known Subclasses: RobotRC, RobotSE Robot (Java: Learning to Program with Robots)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |