// CSE 142, Spring 2010, Marty Stepp // A 'Marty' critter is a not-very-interesting animal that is yellow in color, // moves left (WEST) every time, always uses POUNCE in a fight (to defeat the // Stone, which always uses the ROAR), and looks like an @ on the screen. import java.awt.*; public class Marty extends Critter { private int stepCounter; public Color getColor() { return Color.YELLOW; } public String toString() { return "@"; } public Direction getMove() { stepCounter++; if (stepCounter <= 10) { return Direction.WEST; } else { if (stepCounter >= 20) { stepCounter = 0; } return Direction.EAST; } } public Attack fight(String opponent) { return Attack.POUNCE; } }