import java.util.Random;
public class TextScreen {
  public static void printArray(char[][] a) {
    for(int i = 0; i < a.length; i += 1) {
      for(int j = 0; j < a.length; j += 1) {
        System.out.print(a[i][j]);
      }
      System.out.println();
    }
  }

// Write a static method drawPointsOnGrid, which takes an array of Points
// called points, and an array of array of chars grid, and puts an 'X'
// on each place on the grid corresponding to the given points
// Assume grid has the same width and height
public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < points.length; i += 1) {
    if(!(points[i].x >= grid.length || points[i].y >= grid.length)) {
      grid[points[i].y][points[i].x] = 'X';
    }
  }
}
/*
public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < points.length; i += 1) {
    if(points[i].x >= grid.length || points[i].y >= grid.length) {
      grid[points[i].y][points[i].x] = 'X';
    }
  }
}
*/
/*
public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < grid.length; i += 1) {
    for(int j = 0; j < grid.length; j += 1) {
      if(points[i].x == i && points[i].y == j) {
        grid[i][j] = 'X';
      }
    }
  }
}
public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < grid.length; i += 1) {
    for(int j = 0; j < grid.length; j += 1) {
      if(points[i].y == i && points[i].x == j) {
        grid[i][j] = 'X';
      }
    }
  }
}
*/


  public static void main(String[] args) {

    char[][] grid = new char[10][10];
    for(int i = 0; i < grid.length; i += 1) {
      for(int j = 0; j < grid.length; j += 1) {
        grid[i][j] = ' ';
      }
    }

    Point[] lamPoints = {
      new Point(0, 0),
      new Point(1, 1),
      new Point(2, 2),
      new Point(1, 3), new Point(3, 3),
      new Point(0, 4), new Point(4, 4)
    };

    for(int i = 0; i < lamPoints.length; i += 1) {
      lamPoints[i].moveX(4);
    }

    drawPointsOnGrid(lamPoints, grid);

    printArray(grid);


/*
    grid[0][0] = 'X';
    grid[5][0] = 'X';
    grid[5][5] = 'X';
    grid[9][0] = 'X';
    printArray(grid);
    */
    

    

/*
    char[][] a = {
      {'-', '-', '-', '-', '-'},
      {'-', '-', '-', '-', '-'},
      {'-', '-', '-', '-', '-'},
      {'-', '-', '-', '-', '-'},
      {'-', '-', '-', '-', '-'},
    };
    a[0][0] = 'X';
    a[1][1] = 'X';
    a[2][2] = 'X';
    a[3][1] = 'X'; a[3][3] = 'X';
    a[4][0] = 'X'; a[4][4] = 'X';
    printArray(a);
*/
    /* What will this print?
A               B

X----           -----
-X---           -----
--X--           XXXXX
-X-X-           --X--
X---X           --X--

C               D

X---X           X---X  
-X-X-           -X-X-
--X--           --X--
-X-X-           ---X-
X---X           ----X

    */

  }

}


/*

    Point[] lamPoints = {
      new Point(0, 0),
      new Point(1, 1),
      new Point(2, 2),
      new Point(1, 3), new Point(3, 3),
      new Point(0, 4), new Point(4, 4)
    };
*/


/*
// Write a static method drawPointsOnGrid, which takes an array of Points
// called points, and an array of array of chars grid, and puts an 'X'
// on each place on the grid corresponding to the given points
// Assume grid has the same width and height
public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < points.length; i += 1) {
    if(!(points[i].x >= grid.length || points[i].y >= grid.length)) {
      grid[points[i].y][points[i].x] = 'X';
    }
  }
}

public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < points.length; i += 1) {
    if(points[i].x >= grid.length || points[i].y >= grid.length) {
      grid[points[i].y][points[i].x] = 'X';
    }
  }
}

public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < grid.length; i += 1) {
    for(int j = 0; j < grid.length; j += 1) {
      if(points[i].x == i && points[i].y == j) {
        grid[i][j] = 'X';
      }
    }
  }
}

public static void drawPointsOnGrid(Point[] points, char[][] grid) {
  for(int i = 0; i < grid.length; i += 1) {
    for(int j = 0; j < grid.length; j += 1) {
      if(points[i].y == i && points[i].x == j) {
        grid[i][j] = 'X';
      }
    }
  }
}

*/
