Don't like ads? PRO users don't see any ads ;-)

p23BugRunner4c.java

By: calcpage on Apr 16th, 2012  |  syntax: Java 5  |  size: 0.78 KB  |  hits: 35  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /*
  2. BugRunner4c.java                MrG             2012.0403
  3. purpose:                test out the gridworld env
  4. required files:         ./BugRunner4c.java
  5.                         ../../gridworld.jar
  6. translator phase:       javac -classpath .:../../gridworld.jar BugRunner4c.java
  7. interpreter phase:      java -classpath .:../../gridworld.jar BugRunner4c
  8. */
  9.  
  10. //imported classes
  11. import info.gridworld.actor.ActorWorld;
  12. import info.gridworld.actor.Bug;
  13. import info.gridworld.actor.Rock;
  14.  
  15. import info.gridworld.grid.Location;
  16. import info.gridworld.grid.Grid;
  17.  
  18. //main class
  19. public class BugRunner4c
  20. {
  21.     public static void main(String[] args)
  22.     {
  23.         ActorWorld world = new ActorWorld();
  24.         Bug b = new Bug();
  25.         world.add(b);
  26.         Grid g = b.getGrid();
  27.         b.removeSelfFromGrid();
  28.         b.putSelfInGrid(g, new Location(5,5));
  29.         world.show();
  30.     }
  31. }