harvester
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
harvester [2019/08/23 09:53] – frchris | harvester [2019/08/30 09:49] – frchris | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | The Harvester could also be called a Roomba-- this robot will pick up all the beepers, | ||
+ | If you have a strategy, try it out. If you want a suggestion you can try this: | ||
+ | * A method could pick up a row beepers, stoping when there are no others | ||
+ | * A method that would turn North and turn toward the new row | ||
+ | * If there are beepers to pick up, continue again, otherwise '' | ||
+ | |||
+ | |||
+ | ====== Harvester.java ====== | ||
+ | <code java> | ||
+ | import kareltherobot.Robot; | ||
+ | |||
+ | public class Harvester extends Robot | ||
+ | { | ||
+ | |||
+ | public Harvester(int street, int avenue, | ||
+ | Direction direction, int beepers) | ||
+ | { | ||
+ | super(street, | ||
+ | |||
+ | } | ||
+ | |||
+ | public void nameYourMethodHere() | ||
+ | { | ||
+ | // your code here | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
====== HarvesterRunner.java ====== | ====== HarvesterRunner.java ====== | ||
<code java> | <code java> | ||
Line 48: | Line 78: | ||
{ | { | ||
Harvester farmer = new Harvester(2, | Harvester farmer = new Harvester(2, | ||
- | // your code here to | + | // your code here to use your new method(s) |
farmer.turnOff(); | farmer.turnOff(); | ||
harvester.txt · Last modified: 2020/08/27 11:44 by frchris