harvester

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
harvester [2019/08/23 09:53] frchrisharvester [2020/08/27 11:44] (current) – [Harvester.java] frchris
Line 1: Line 1:
 +The Harvester could also be called a Roomba-- this robot will pick up all the beepers, 
 +ending facing West at Street7, Avenue 2.
 +
 +{{::harvesterstart.png?400|}}
 +
 +If you have a strategy, go for it, and 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 ''turnOff()''
 +
 +
 ====== Harvester.java ====== ====== Harvester.java ======
 <code java> <code java>
 import kareltherobot.Robot; import kareltherobot.Robot;
 +//  @author Your Name
 +public class Harvester extends Robot
 +{
  
-public class Harvester extends Robot{ +    public Harvester(int street, int avenue,  
- +         Direction direction, int beepers)  
- public Harvester(int street, int avenue,  +    
-         Direction direction, int beepers) { + super(street, avenue, direction, beepers);
- super(street, avenue, direction, beepers);+
   
- }+    } 
     public void nameYourMethodHere()     public void nameYourMethodHere()
     {     {
Line 68: Line 82:
         {         {
  Harvester farmer = new Harvester(2,2,East,0);  Harvester farmer = new Harvester(2,2,East,0);
-                // your code here to +                // your code here to use your new method(s)
  farmer.turnOff();  farmer.turnOff();
   
harvester.1566568438.txt.gz · Last modified: by frchris

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki