title: Loop diagonally through two dimensional array
body: <p>I wrote the following code to walk half the diagonals of an array:</p>
  
  <pre><code>String[][] b = [a,b,c]
                 [d,e,f]
                 [g,h,i];  
  
  public void LoopDiag()
     for (int i = b.length - 1; i &gt; 0; i--) {
         String temp = "";
         for (int j = 0, x = i; x &lt;= b.length - 1; j++, x++) {
            temp = temp+b[x][j];
         }
         System.out.println(temp)
     }
  
  
     for (int i = 0; i &lt;= b.length - 1; i++) {
          String temp = "";
          for (int j = 0, y = i; y &lt;= b.length - 1; j++, y++) {
          temp = temp+b[j][y];
          }
          System.out.println(temp);
     }
  }
  </code></pre>
  
  <p>Right now it prints the diagonals i.e current output:  </p>
  
  <pre><code>g dh aei bf c
  </code></pre>
  
  <p>How do I make it print the other half diagonals i.e required output:  </p>
  
  <pre><code>a db gec hf i 
  </code></pre>