Virginia Tech - CS 1114CopyingJeroo.java
// Virginia Tech Honor Code Pledge:
//
// As a Hokie, I will conduct myself with honor and integrity at all times.
// I will not lie, cheat, or steal, nor will I accept the
...
Virginia Tech - CS 1114CopyingJeroo.java
// Virginia Tech Honor Code Pledge:
//
// As a Hokie, I will conduct myself with honor and integrity at all times.
// I will not lie, cheat, or steal, nor will I accept the actions of those
// who do.
// -- Emily Ashburn (emily2000)
import sofia.micro.jeroo.*;
//-------------------------------------------------------------------------
/**
* A jeroo that traverses all locations on an island, and uses
* a buddy to make a copy of any pattern of flowers it finds.
*
* @author Emily Ashburn (emily2000)
* @version (2019.03.22)
*/
public class CopyingJeroo extends Jeroo
{
//~ Fields ................................................................
private Jeroo copier;
//~ Constructor ...........................................................
// ----------------------------------------------------------
/**
* Creates a new CopyingJeroo object.
* @param jared the copier jeroo
*/
public CopyingJeroo(Jeroo jared)
{
super();
copier = new Jeroo(10, 1, 1000);
copier = jared;
}
//~ Methods ...............................................................
// ----------------------------------------------------------
/**
* Creates a new CopyingJeroo object.
*/
public void myProgram()
{
while (!(this.getGridY() == 8 && this.getGridX() == 1))
{
this.scanIsland();
}
}
/**
* Hop forward until we reach the water.
*/
public void hopToWater()
{
while (!this.seesWater(AHEAD))
{
this.pickAndPlant();
this.hop();
}
}
/**
* Go over the whole island
*/
public void scanIsland()
********************************** CONTINUED IN THE ATTACHMENT ***********************************
[Show More]