gridWorldTest
Class BoxBug

java.lang.Object
  extended by info.gridworld.actor.Actor
      extended by info.gridworld.actor.Bug
          extended by gridWorldTest.BoxBug

public class BoxBug
extends Bug

A BoxBug traces out a square "box" of a given size.
The implementation of this class is testable on the AP CS A and AB exams.


Constructor Summary
BoxBug(int length)
          Constructs a box bug that traces a square of a given side length
 
Method Summary
 void act()
          Moves to the next location of the square.
 
Methods inherited from class info.gridworld.actor.Bug
canMove, move, turn
 
Methods inherited from class info.gridworld.actor.Actor
getColor, getDirection, getGrid, getLocation, moveTo, putSelfInGrid, removeSelfFromGrid, setColor, setDirection, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BoxBug

public BoxBug(int length)
Constructs a box bug that traces a square of a given side length

Parameters:
length - the side length
Method Detail

act

public void act()
Moves to the next location of the square.

Overrides:
act in class Bug