/* 
 * AP(r) Computer Science GridWorld Case Study:
 * Copyright(c) 2005-2006 Cay S. Horstmann (http://horstmann.com)
 *
 * This code is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * @author Cay Horstmann
 * @author Chris Nevison
 * @author Barbara Cloud Wells
 */

import info.gridworld.actor.ActorWorld;
import info.gridworld.grid.Location;

import java.awt.Color;

/**
 * This class runs a world that contains box bugs. <br />
 * This class is not tested on the AP CS A and AB exams.
 */
public class BoxBugRunner
{
    public static void main(String[] args)
    {
        ActorWorld world = new ActorWorld();
        BoxBug alice = new BoxBug(6);
        alice.setColor(Color.ORANGE);
        BoxBug bob = new BoxBug(3);
        world.add(new Location(7, 8), alice);
        world.add(new Location(5, 5), bob);
        world.show();
    }
}
@@ -690,45 +690,83 @@
 rld.
-grid.Location;%0A%0Aimport java.awt.Color
+actor.Actor;%0Aimport info.gridworld.actor.Rock;%0Aimport info.gridworld.grid.*
 ;%0A%0A/
@@ -916,13 +916,29 @@
 nner
-%0A%7B%0A  
+ implements Colors %7B%0A
   pu
@@ -977,19 +977,73 @@
 rgs)
+ %7B
 %0A    
-%7B%0A    
+BoundedGrid%3CActor%3E grid = new BoundedGrid%3CActor%3E(20, 20);%0A
     
@@ -1076,23 +1076,28 @@
 orWorld(
+grid
 );%0A    
+%0A
     BoxB
@@ -1122,20 +1122,16 @@
 Bug(6);%0A
-    
     alic
@@ -1145,27 +1145,67 @@
 lor(
+all
 Color
-.ORANGE
+s%5B(int) (Math.random() * allColors.length)%5D
 );%0A    
+%0A
     
@@ -1232,24 +1232,96 @@
 Bug(3);%0A    
+bob.setColor(allColors%5B(int) (Math.random() * allColors.length)%5D);%0A    %0A
     world.ad
@@ -1350,28 +1350,24 @@
 alice);%0A    
- 
-   
 world.add(ne
@@ -1394,16 +1394,17 @@
 b);%0A    
+%0A
     worl
@@ -1413,15 +1413,13 @@
 show();%0A
-  
   %7D%0A%7D

Clean up default BoxBugRunner