// CSE 142 Homework 8 (Critter Safari) // Authors: Marty Stepp and Stuart Reges // import java.awt.*; public class RadioactiveStone implements Critter { // fields private int moves; public RadioactiveStone() { moves = 0; } public int fight(String opponent) { return ROAR; // good ol' ROAR... nothing beats that! } // alternates color between red and blue public Color getColor() { if (moves % 2 == 0) { return Color.RED; } else { return Color.BLUE; } } // goes 3 left, 3 right, 3 left, 3 right, ... public int getMove(CritterInfo info) { moves++; if (moves % 6 < 3) { return WEST; } else { return EAST; } } public String toString() { return "S"; // displays stone as S } }