public static String getPrettyPath ( List < Puzzle > path , int size ) { // Print each row of all states StringBuffer output = new StringBuffer ( ) ; for ( int y = 0 ; y < size ; y ++ ) { String row = "" ; for ( Puzzle state : path ) { int [ ] [ ] board = state . getMatrixBoard ( ) ; row += "| " ; for ( int x = 0 ; x < size ; x ++ ) { row += board [ y ] [ x ] + " " ; } row += "| " ; } row += "\n" ; output . append ( row ) ; } return output . toString ( ) ; }
Prints a search path in a readable form .