| 17 | private final Node goal; |
| 18 | |
| 19 | private class Node implements Comparable<Node> { |
| 20 | final Board board; |
| 21 | final Node prev; |
| 22 | final int moves; |
| 23 | final int manhattanScore; |
| 24 | |
| 25 | Node(Board b, Node p, int m) { |
| 26 | board = b; |
| 27 | prev = p; |
| 28 | moves = m; |
| 29 | manhattanScore = m + b.manhattan(); |
| 30 | } |
| 31 | |
| 32 | public int compareTo(Node that) { |
| 33 | return Integer.compare(this.manhattanScore, that.manhattanScore); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // find a solution to the initial board (using the A* algorithm) |
| 38 | public Solver(Board initial) { |
nothing calls this directly
no outgoing calls
no test coverage detected