title: Creating a sliding number puzzle board using arrays in Java
body: <p>So I'm kind of new to Java and decided to create a sliding number puzzle of some sort. Here's what I have :</p>
  
  <pre><code>int[] puz = {1,2,3,
               4,5,6,
               7,8,9}
  for(int i=0; i&lt;puz.length; i++){
      System.out.println(puz[i]);
  }
  </code></pre>
  
  <p>The 1 is supposed to be the blank spot but I'll figure that out later. My problem is that the code prints:</p>
  
  <pre><code>1
  2
  3
  4
  5
  6
  7
  8
  9
  </code></pre>
  
  <p>when I want it to print:</p>
  
  <pre><code>1 2 3
  4 5 6
  7 8 9
  </code></pre>
  
  <p>I've also tried doing a nested loop that I'm too embarrassed to show on here due to how hideous it was.
  Would I try using a 2d array instead?</p>