// Zorah Fung, CSE 142 // Hipster critters congregate at a cheap bar. The bar's location is shared among // all Hipsters // Hipsters move north until reaching the y coordinate of the bar and then east until // reaching the x coordinate of the bar. import java.util.*; public class Hipster extends Critter { // static makes this a shared location private static Random r = new Random(); private static int cheapBarX = r.nextInt(60); private static int cheapBarY = r.nextInt(50); // Move N then E until the bar is reached public Direction getMove() { if (getY() != cheapBarY) { return Direction.NORTH; } else if (getX() != cheapBarX) { return Direction.EAST; } else { // reached the bar return Direction.CENTER; } } }