Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package bellgridworld;
- import info.gridworld.actor.Critter;
- import info.gridworld.grid.*;
- import java.util.ArrayList;
- public class BellTestBug extends Critter{
- private int steps;
- private int sideLength, nuke, count;
- public BellTestBug(){
- sideLength = 0;
- count = 0;
- }
- public void act(){
- ArrayList locs = getGrid().getValidAdjacentLocations(getLocation());
- for(int i = 0; i < locs.size(); i++){
- new BellTestBug().putSelfInGrid(this.getGrid(), (Location)locs.get(i));
- }
- move();
- }
- public void move()
- {
- ArrayList asdf = getGrid().getOccupiedLocations();
- for(int f = 0; f < asdf.size(); f++)
- if(!(getGrid().get((Location) asdf.get(f)) instanceof BellTestBug))
- {
- makeMove((Location) asdf.get(f));
- return;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement