Java console output using two dimensional arrays
<p>I'm looking for insight as to how to print two dimensional arrays from left to right as opposed to cascading down the page with newline characters. </p>

<p>I've written a simple program for an undergraduate A.I. course that solves that little 9-tile games.</p>

<pre><code>public void printNode(){
    for(int i = 0; i &lt; 3; i ++){
        System.out.printf("[ ");
        for(int k = 0; k &lt; 3; k++){
            System.out.printf(" " + state[i][k] + " ");
        }
        System.out.printf("]\n");
    }
}
</code></pre>

<p>This prints the two dimensional array with no problems. </p>

<p>But I'm looking for a way to print the arrays from left to right so I don't have to turn in 50+ pages of transformations to prove my program works. Has anyone solved this problem before?</p>

<pre><code>[ 1 2 3 ] [1 2 3]
[ 8 0 4 ] [8 0 4]
[ 7 6 5 ] [7 6 5]
</code></pre>

<p>This is the effect I want to create. The solution path of transformations is a series of pointers leading back up the chain. Each of my Node's has a pointer to its ancestor. So I can easily follow the pointers back and print them all.</p>
