public ArrayList<Square> getNeighbors()
    {
        ArrayList<Square> nabors=new ArrayList<Square>();
        for (int x=gx-1;x<=gx+1;x++)
        {
            for (int y=gy-1;y<=gy+1;y++)
            {
                if ( (x==gx) ^ (y==gy))//removes diagonals and center
                {
                    if (Square.xInBounds(x) && Square.yInBounds(y))
                    {
                        nabors.add(getSquare(x,y));
                    }
                }
            }
        }
        return nabors;
    }