【发布时间】:2011-11-22 09:24:13
【问题描述】:
我在 Java 2D 数组 int[][] 状态下实现 NxN puzzels。我需要通过以下方式使用曼哈顿启发式:
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 编写这段代码?
【问题讨论】: