// CSE 142, Autumn 2010, Jessica Miller // A class to represent a FratGuy critter. // FratGuys all agree on one spot (via static fields) and converge there. import java.util.*; public class FratGuy extends Critter { private static int barX = -1; private static int barY = -1; public FratGuy() { if (barX == -1 && barY == -1) { Random rand = new Random(); barX = rand.nextInt(60); barY = rand.nextInt(50); } } public Direction getMove() { if (barY != getY()) { return Direction.NORTH; } else if (barX != getX()) { return Direction.EAST; } else { return Direction.CENTER; } } }