// Bob O'Neill

// Robert Langlands 

// CSUSM 2010

// This Critter moves like a Knight Chess Piece

import java.util.ArrayList;

import info.gridworld.actor.*;

import java.awt.Color;

import info.gridworld.grid.*;



public class Robob extends Critter{


    public Robob(){

           setColor(Color.WHITE);

    }


    public ArrayList<Location> getMoveLocations(){

        ArrayList<Location> locs = new ArrayList<Location>();

//         int maxRow = getNumRows();

//         int maxCol = getNumCols();

        Location current = getLocation();

        Location nextLoc = new Location(current.getRow() - 2, current.getCol() + 1);       

        if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        nextLoc = new Location(current.getRow() - 1, current.getCol() + 2);

         if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        nextLoc = new Location(current.getRow() + 1, current.getCol() + 2);

         if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        nextLoc = new Location(current.getRow() +2, current.getCol() + 1);

         if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        nextLoc = new Location(current.getRow() +2, current.getCol() -1);

         if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        nextLoc = new Location(current.getRow() +1, current.getCol() -2);

         if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        nextLoc = new Location(current.getRow() - 1, current.getCol() -2);

         if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        nextLoc = new Location(current.getRow() - 2, current.getCol() -1);

         if (getGrid().isValid(nextLoc)){

            System.out.println("yes");

            locs.add(nextLoc);

        }

        return locs;

    }

    

//     public Location selectMoveLocation (ArrayList<Location> locs){

//         

//     }

}