Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. public class Frog extends Critter (int age){
  2.    int x = age-1;
  3.    
  4.    public Color getColor(){
  5.       return Color.GREEN;
  6.    }
  7.    
  8.    public Direction getMove(){
  9.       age++;
  10.      
  11.       if (x % age == 0)
  12.       return Direction.CENTER;
  13.      
  14.       return Direction.EAST;
  15.      
  16.    }
  17.    
  18.    public String toString(){
  19.       return "F";
  20.    }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement