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)

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 are the implementations for the five classes:

```java
import java.util.Random;

// Implements the Critter interface and defines the behavior of the Bird
public class Bird implements Critter {
private Random random;

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

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

@Override
public int getMove(CritterInfo info) {
return random.nextInt(4); // return a random direction (0, 1, 2, or 3)
}
}

// Implements the Critter interface and defines the behavior of the Frog
public class Frog implements Critter {
private Random random;
private int directionCount;
private int currentDirection;

public Frog() {
random = new Random();
directionCount = 0;
currentDirection = random.nextInt(4); // pick a random initial direction
}

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

@Override
public int getMove(CritterInfo info) {
if (directionCount == 0) {
currentDirection = random.nextInt(4); // pick a new random direction
directionCount = 3; // repeat the direction 3 times
} else {
directionCount--;
}
return currentDirection;
}
}

// The remaining classes won't be implemented since they aren't specified in the task.
public class Wolf implements Critter {
// Implementation of Wolf class goes here
}

public class Grass implements Critter {
// Implementation of Grass class goes here
}

public class Rock implements Critter {
// Implementation of Rock class goes here
}
```

In this implementation, the Bird class randomly selects one of the four directions each time the `getMove()` method is called. The Frog class picks a random direction and moves 3 cells in that direction, and then repeats the same direction for the next 3 moves. The other three classes (Wolf, Grass, Rock) are not implemented as their behavior is not specified in the task.