Advertisement
calcpage

GWP2_BoxBugRunner.java

Mar 26th, 2012
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.22 KB | None | 0 0
  1. /*
  2.  * AP(r) Computer Science GridWorld Case Study:
  3.  * Copyright(c) 2005-2006 Cay S. Horstmann (http://horstmann.com)
  4.  *
  5.  * This code is free software; you can redistribute it and/or modify
  6.  * it under the terms of the GNU General Public License as published by
  7.  * the Free Software Foundation.
  8.  *
  9.  * This code is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * @author Cay Horstmann
  15.  * @author Chris Nevison
  16.  * @author Barbara Cloud Wells
  17.  */
  18.  
  19. import info.gridworld.actor.ActorWorld;
  20. import info.gridworld.grid.Location;
  21.  
  22. import java.awt.Color;
  23.  
  24. /**
  25.  * This class runs a world that contains box bugs. <br />
  26.  * This class is not tested on the AP CS A and AB exams.
  27.  */
  28. public class BoxBugRunner
  29. {
  30.     public static void main(String[] args)
  31.     {
  32.         ActorWorld world = new ActorWorld();
  33.         BoxBug alice = new BoxBug(6);
  34.         alice.setColor(Color.ORANGE);
  35.         BoxBug bob = new BoxBug(3);
  36.         world.add(new Location(7, 8), alice);
  37.         world.add(new Location(5, 5), bob);
  38.         world.show();
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement