private Point[] getPossibleMoves(int x, int y)
  {
    ArrayList<Point> moves = new ArrayList<Point>();
    for (Point p : moveRules)
    {
      int newX = x + p.x,
          newY = y + p.y;

      if (newX >= 0 && newX < columns && newY >= 0 && newY < rows && !board[newY][newX])
        moves.add(new Point(newX, newY));
    }

    return moves.toArray(new Point[moves.size()]);
  }