title: Rendering a 1 dimensional array as a grid?
body: <p>I can draw a two dimension array in a grid like so:</p>
  
  <pre><code>int[][] foo = new int[10][10];
  
  // assume the array is full of data
  for (int x = 0; x &lt; 10; x++) {
      for (int y = 0; y &lt; 10; y++) {
          g.setColor(new Color(foo[x][y] &amp; 255, foo[x][y] &amp; 255, foo[x][y] &amp; 255));
          g.fillRect(x * 50, y * 50, 50, 50);
      }
  }
  </code></pre>
  
  <p>Is there any way I can do the same with
  a 1 dimensional array? Is there any magical
  math operations I can do each iteration, 
  or do I have to fill it into a 2d array
  manually?</p>