// One possible solution appears below. public class Ferret extends Critter { private int infectCount; private Random r; public Ferret() { r = new Random(); } public Action getMove(CritterInfo info) { if (infectCount > 0) { infectCount--; } if (info.getFront() == Neighbor.OTHER) { infectCount = 5; return Action.INFECT; } else if (info.getFront() == Neighbor.EMPTY) { return Action.HOP; } else { int choice = r.nextInt(2); if (choice == 0) { return Action.LEFT; } else { return Action.RIGHT; } } } public Color getColor() { if (infectCount > 0) { return Color.RED; } else { return Color.BLUE; } } public String toString() { return "I=" + infectCount; } }