java - coordinates into an array
<p>I'm trying to figure out how to get these rectangles coordinates into an array(using a loop), but I can't get them right. The values in the array in default are "false". For example if the coordinates are 0, 24 blockCoords[0][1] shoud be "true". Sorry for my English, I'm not a native speaker :P</p>

<pre><code>boolean[ ][ ] blockCoords = new boolean[20][10];//the array

//added the code to create the array
  private void createArray() {
        for(int i=0;i&lt;20;i++) {
             for(int j=0;j&lt;10;j++) {
                  blockCoords[i][j]=false;
          }
      }
  }
//b is the block
int y1 = b.getY();//get the coordinates of the top of a block
int y2 = b.getHeight();//the height of a block
int x1 = b.getX();
int x2 = b.getWidth();
int numHorizontal = 10-((240-x2)/24);//calculates how many blocks there are - 24 is the width and the height of a block - 240/480 are the dimensions
int numVertical = 20-((480-y2)/24);
int col=10-((240-x1)/24);//in which column does the block's coordinates start in
int row=((480-y1)/24)-1;// same for the row
</code></pre>
