登录
首页 » 数据结构 » 八 方块移动游戏要求从一个含8个数字(用1

八 方块移动游戏要求从一个含8个数字(用1

于 2022-03-22 发布 文件大小:2.48 kB
0 79
下载积分: 2 下载次数: 1

代码说明:

八 方块移动游戏要求从一个含8个数字(用1-8表示)的方块以及一个空格方块(用0表示)的3x3矩阵的起始状态开始,不断移动该空格方块以使其和相邻的方 块互换,直至达到所定义的目标状态。空格方块在中间位置时有上、下、左、右4个方向可移动,在四个角落上有2个方向可移动,在其他位置上有3个方向可移 动。例如,假设一个3x3矩阵的初始状态为: 8 0 3 2 1 4 7 6 5 目标状态为: 1 2 3 8 0 4 7 6 5-Eight-box requirements of mobile games from one containing eight numbers (1-8 with express) the box, as well as a space box (with 0) of the 3x3 matrix of the initial start, and constantly move the box to make space its adjacent box and swap until they reach their defined target state. Spaces in the middle position box has the upper and lower, left and right direction of four removable, in the four corners there are two directions can be mobile, in other locations has three movable direction. For example, suppose a 3x3 matrix of the initial state as follows: 803,214,765 target state as follows: 123,804,765

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696522资源总数
  • 104029会员总数
  • 31今日下载