title: For loop in Java for filling up table
body: <p>Let's say i have a table format in Java </p>
  
  <pre><code>  0    1    2
  |_E_|____|____| 0
  |___|____|____| 1
  </code></pre>
  
  <p>Where the numbers at the top are the index of the column and the numbers on the side are the index of the row. A function:</p>
  
  <pre><code>add_at(x,y)
  </code></pre>
  
  <p>takes two arguments x and y which is the x coordinate and y coordinate. I'm trying to fill up the table using a for loop for which it begins from the position 0,1 which is</p>
  
  <pre><code>  0    1    2
  |_E_|__x_|____| 0
  |___|____|____| 1
  </code></pre>
  
  <p>marked with x, followed by 0,2</p>
  
  <pre><code>  0    1    2
  |_E_|__x_|__x_| 0
  |___|____|____| 1
  </code></pre>
  
  <p>proceeding with</p>
  
  <pre><code>  0    1    2
  |_E_|__x_|__x_| 0
  |_x_|____|____| 1
  
    0    1    2
  |_E_|__x_|__x_| 0
  |_x_|__x_|____| 1
  
    0    1    2
  |_E_|__x_|__x_| 0
  |_x_|__x_|__x_| 1
  </code></pre>
  
  <p>until the table is filled except for the location 0,0 which is marked by E.</p>
  
  <pre><code>int max_row = 1;    //maximum row length is 1
  int max_col = 2;    //maximum column length is 2
  
  for (int x = 0; x&lt;=max_row; x++) {
      for (int y = 1; y&lt;max_col; y++) {
          this.add_at(x,y)
          }
      }
  </code></pre>
  
  <p>I'm a beginner at Java and I'm pretty sure the for loop i wrote is wrong in a way where i wanted the output to be. Would appreciate some help on this.</p>