public class Grasshopper extends Critter { private int numFights; private int direction; // 1 NORTH, 2 SOUTH, 3 WEST private int stepCount; private boolean inHop; public Grasshopper() { numFights = 0; stepCount = 0; direction = 1; inHop = false; } // This is super redundanct, but the final won't be graded on style public Direction getMove() { if (!inHop) { return Direction.CENTER; } if (direction == 1) { stepCount++; if (stepCount == numFights) { stepCount = 0; direction = 2; } return Direction.NORTH; } else if (direction == 2) { stepCount++; if (stepCount == numFights) { stepCount = 0; direction = 3; } return Direction.SOUTH; } else { // 3 inHop = false; return Direction.WEST; } } public Attack fight(String opponent) { if (inHop) { return Attack.FORFEIT; } else { inHop = true; // This is the line we forgot in class numFights++; direction = 1; return Attack.ROAR; } } }