文件名称:8数码
介绍说明--下载内容均来自于网络,请自行研究使用
需要说明的是:本文示例图中的目标状态在计算上是最快捷的,首先取数很方便,一般地查看目标在第i个位置上的值,则需要访问数组goal[i],而这里goal[i]==i,故而无需访问数组;第二,要想知道数码n的目标位置,则需要找到goal[i]==n,然后row=i/3,col=i%3. 但是这里的话,row=n/3,col=n%3. 当我们用8位无符号整型来表示各个数码值(0~8)时,n/3和n%3操作是非常快的,比访问数组还快。
程序还提供一种玩游戏模式,即用户自己通过W,S,A,D四个键分别控制空格往上、下、左、右四个方向移动一步,功能很简单,界面部分是用OpenCV做的。界面部分和搜索部分是完全分离的,demo文件中main函数部分显示了如何将它们组合使用。(Need explanation is: This paper sample figure in the target state is the most efficient in calculation, the first number is very convenient, generally view the targets in the I position on the value, requires access to an array of goal[i], where goal[i]==i, therefore no need to access the array; second, to know the digital n the position of the target, you need to find goal[i]==n, row=i/3 and col=i%3., but here, row=n/3, col=n%3. when we use 8 bit unsigned integer to the digital value (0~8), n/3 and n%3 operations are very fast, faster than accessing array.
Program also provides a play game mode, that is, users themselves through W, S, A, D, four keys, respectively, control space, up, down, left, right four directions move a step, the function is very simple, the interface part is done with OpenCV. The interface section is completely separate from the search section, and the main function section in the demo file shows how to combine them.)
程序还提供一种玩游戏模式,即用户自己通过W,S,A,D四个键分别控制空格往上、下、左、右四个方向移动一步,功能很简单,界面部分是用OpenCV做的。界面部分和搜索部分是完全分离的,demo文件中main函数部分显示了如何将它们组合使用。(Need explanation is: This paper sample figure in the target state is the most efficient in calculation, the first number is very convenient, generally view the targets in the I position on the value, requires access to an array of goal[i], where goal[i]==i, therefore no need to access the array; second, to know the digital n the position of the target, you need to find goal[i]==n, row=i/3 and col=i%3., but here, row=n/3, col=n%3. when we use 8 bit unsigned integer to the digital value (0~8), n/3 and n%3 operations are very fast, faster than accessing array.
Program also provides a play game mode, that is, users themselves through W, S, A, D, four keys, respectively, control space, up, down, left, right four directions move a step, the function is very simple, the interface part is done with OpenCV. The interface section is completely separate from the search section, and the main function section in the demo file shows how to combine them.)
相关搜索: 8数码
(系统自动生成,下载前可以参看下载内容)
下载文件列表
8数码
8数码\8数码.exe
8数码\Astar.cpp
8数码\Astar.h
8数码\demo.cpp
8数码\puzzle8.cpp
8数码\puzzle8.h
8数码\puzzle_game.cpp
8数码\puzzle_game.h
8数码\8数码.exe
8数码\Astar.cpp
8数码\Astar.h
8数码\demo.cpp
8数码\puzzle8.cpp
8数码\puzzle8.h
8数码\puzzle_game.cpp
8数码\puzzle_game.h