(String[] args)
| 86 | } |
| 87 | |
| 88 | public static void main(String[] args) { |
| 89 | // create initial board from file |
| 90 | In in = new In(args[0]); |
| 91 | int n = in.readInt(); |
| 92 | int[][] tiles = new int[n][n]; |
| 93 | for (int i = 0; i < n; i++) |
| 94 | for (int j = 0; j < n; j++) |
| 95 | tiles[i][j] = in.readInt(); |
| 96 | Board initial = new Board(tiles); |
| 97 | |
| 98 | // solve the puzzle |
| 99 | Solver solver = new Solver(initial); |
| 100 | |
| 101 | // print solution to standard output |
| 102 | if (!solver.isSolvable()) |
| 103 | StdOut.println("No solution possible"); |
| 104 | else { |
| 105 | StdOut.println("Minimum number of moves = " + solver.moves()); |
| 106 | for (Board board : solver.solution()) |
| 107 | StdOut.println(board); |
| 108 | } |
| 109 | } |
| 110 | } |
nothing calls this directly
no test coverage detected