You are to implement five classes. The behavior of each class is described below.

Class getChar getMove

Bird B Randomly selects one of the four directions each time

Frog F Picks a random direction, moves 3 in that direction, repeat (same as bird, but staying in a single direction longer)

Mouse M West 1, north 1, repeat (zig zag to the NW)

Turtle T South 5, west 5, north 5, east 5, repeat (clockwise box)

Wolf

You decide

You define this

For the random moves, each possible choice must be equally likely. You may use either a Random object or the Math.random() method to obtain pseudorandom values.

The first four of these classes won’t use the CritterInfo object that is passed to getMove. This object is provided in case you want to do something with this information in defining your Wolf class. See the description of CritterInfo later in the writeup.

The critter world is divided into cells that have integer coordinates, much like the pixels in a DrawingPanel. There are 100 cells across and 50 cells up and down. As with the DrawingPanel, the upper-left cell has coordinates (0, 0), increasing x values move you right and increasing y values move you down.

Notice that the Critter class defines five constants for the various directions. You can refer to these using the name of the interface (Critter.NORTH, Critter.SOUTH, etc) or you can refer to them directly (NORTH, SOUTH, etc) because you are implementing the interface. Your code should not depend upon the specific values assigned to these constants, although you may assume they will always be of type int. You will lose style points if you fail to use the named constants when appropriate. As noted above, your critter can stay in its current location by indicating that the direction it wants to move is CENTER.

Here is one possible implementation of the Bird, Frog, Mouse, and Turtle classes:

```java
import java.util.Random;

public class Bird implements Critter {
private Random random;

public Bird() {
random = new Random();
}

public char getChar() {
return 'B';
}

public int getMove(CritterInfo info) {
int direction = random.nextInt(4); // randomly choose a number from 0 to 3
return direction;
}
}

public class Frog implements Critter {
private Random random;
private int currentDirection;
private int steps;

public Frog() {
random = new Random();
currentDirection = random.nextInt(4); // randomly choose a number from 0 to 3
steps = 0;
}

public char getChar() {
return 'F';
}

public int getMove(CritterInfo info) {
if (steps < 3) {
steps++;
} else {
currentDirection = random.nextInt(4); // randomly choose a number from 0 to 3
steps = 0;
}
return currentDirection;
}
}

public class Mouse implements Critter {
private int currentX;
private int currentY;

public Mouse() {
currentX = 0;
currentY = 0;
}

public char getChar() {
return 'M';
}

public int getMove(CritterInfo info) {
if (currentX == 0 && currentY == 0) {
currentX = 1;
return WEST;
} else if (currentX == 1 && currentY == 0) {
currentX = 0;
currentY = 1;
return NORTH;
} else {
currentX = 0;
currentY = 0;
return CENTER;
}
}
}

public class Turtle implements Critter {
private int currentDirection;
private int steps;

public Turtle() {
currentDirection = SOUTH;
steps = 0;
}

public char getChar() {
return 'T';
}

public int getMove(CritterInfo info) {
if (steps < 5) {
steps++;
} else {
switch (currentDirection) {
case SOUTH:
currentDirection = WEST;
break;
case WEST:
currentDirection = NORTH;
break;
case NORTH:
currentDirection = EAST;
break;
case EAST:
currentDirection = SOUTH;
break;
}
steps = 0;
}
return currentDirection;
}
}
```

For the Wolf class, you have the flexibility to define its behavior as required. You can use CritterInfo object to decide the wolf's move. Here's a possible implementation of the Wolf class:

```java
public class Wolf implements Critter {
public char getChar() {
return 'W';
}

public int getMove(CritterInfo info) {
// Implement your wolf's behavior here
return CENTER;
}
}
```

Note: This is just one possible implementation of the classes. There may be other ways to implement the behavior of each critter.