// CSE 142, Autumn 2010, Marty Stepp // This is a simple critter animal that walks west until he eats food, // then he turns around and walks east. // The critter needs to keep track of state (a boolean flag) to "remember" // whether he has eaten. import java.awt.*; // for Color public class Cougar extends Critter { private boolean ateFood; public Cougar() { ateFood = false; } public Color getColor() { return Color.RED; } public boolean eat() { ateFood = true; return true; } public Direction getMove() { if (ateFood) { return Direction.EAST; } else { return Direction.WEST; } } }