I am trying to draw a 4x4 grid using a 2D array. When I run the code, I only draw a square in the lower left corner. I think the issue might be with my y-coordinate but I am not completely sure.
StdDraw.setScale(0,4);
int[][] grid = new int[4][4];
for (int x = 0; x < grid.length; x++)
{
for (int y = 0; y < grid[0].length; y++)
{
StdDraw.setPenColor(StdDraw.BLUE);
StdDraw.filledSquare(grid[x][y], grid[x+1][y+1], 1);
}
}