// A critter representing a bird that flies north and south. // Second version that uses the CritterInfo to help make its move. import java.awt.*; public class Bird implements Critter { // counts how many moves the bird has made private int moveCount; public Bird() { moveCount = 0; } public int fight(String opponent) { return PAPER; } public Color getColor() { return Color.RED; } public int getMove(CritterInfo info) { moveCount++; // If a stone is to the east of me, I will move east and destroy it! String eastNeighbor = info.getNeighbor(EAST); if (eastNeighbor.equals("S")) { return EAST; } else if (moveCount % 3 == 0) { return NORTH; } else { return SOUTH; } } public String toString() { return "!"; } }