我正在使用Java 2D数组int[][] state实现NxN拼图。我需要按以下方式使用曼哈顿启发式:
the sum of the vertical and horizontal distances from
the current node to the goal node/tile
+(plus)
the number of moves to reach the goal node from the initial position
目前我不知道该如何继续了。我是一个2D数组拼图游戏编程的初学者,所以很难理解某些概念。我该如何用Java编写这段代码?