diff --git a/README.md b/README.md index cb7b855..1f022c6 100644 --- a/README.md +++ b/README.md @@ -272,17 +272,19 @@ build文件夹是计算并建立数据库的工作目录,里面的脚本均为 对大多数人来说,纯粹的编码并不直观,而另一方面又需要编码的简洁性来辅助研究;因此我编写了一个编码可视化的小工具,可以根据布局计算编码或根据编码来显示布局样式。 +[**源代码**](./src/visual) + ![visual_tool](./docs/images/visual_tool.png) -工具介绍 +**工具介绍** -+ 通过鼠标拖拽画出棋子 ++ 鼠标拖拽画出棋子 -+ 绘制时违反规则会出现提示 ++ 单击删除棋子 -+ 通过单击删除棋子 ++ 输入编码自动生成布局 -+ 下方文本框输入编码自动生成布局 ++ 绘制时违反规则会出现提示 + 编码输入错误会标红警告 @@ -292,11 +294,22 @@ build文件夹是计算并建立数据库的工作目录,里面的脚本均为 + 完成按钮可补0生成九位编码 -下载 ++ 空白处右键可导出无编码图片 + ++ 空白处点击滚轮可导出带编码图片 + ++ 可设置是否保持窗口最前 + ++ 可设置皮肤颜色 + ++ 可检测更新获取新版本 + + +**下载** -[Git仓库](./tools/HRD_Visual.exe) ++ [Git仓库](./tools/HRD_Visual.exe) -[备用链接](https://hrd.dnomd343.top/download/HRD_Visual.exe) ++ [备用链接](https://hrd.dnomd343.top/download/HRD_Visual.exe) ## 关于开源 diff --git a/docs/demo.md b/docs/demo.md index d33723c..5e442af 100644 --- a/docs/demo.md +++ b/docs/demo.md @@ -220,6 +220,28 @@ int main() { cout << endl; cout << "---------------------------" << endl; + // 得到布局的连接结构 + demo.quiet = true; + cout << "Get all path of 4FEA13400..." << endl; + demo.Analyse_Case(0x4FEA13400); + demo.Output_All_Path("demo-4FEA13400.txt"); + cout << "Data save at demo-4FEA13400.txt" << endl; + cout << "---------------------------" << endl; + + // 计算到达特定布局的所有路径 + cout << "start: 4FEA13400" << endl; + vector dat; + dat.push_back(0x1BED0B400); + dat.push_back(0xD9B9F3000); + cout << "target:"; + for (unsigned int i = 0; i < dat.size(); i++) { + cout << " " << demo.Change_str(dat[i]); + } + cout << endl; + demo.Output_Path(dat, "demo-4FEA13400-target.txt"); + cout << "Data save at demo-4FEA13400-target.txt" << endl; + cout << "---------------------------" << endl; + return 0; } ``` diff --git a/docs/images/layer_eg.png b/docs/images/layer_eg.png new file mode 100644 index 0000000..8fee005 Binary files /dev/null and b/docs/images/layer_eg.png differ diff --git a/docs/images/visual_tool.png b/docs/images/visual_tool.png index e1a0f76..1af5452 100644 Binary files a/docs/images/visual_tool.png and b/docs/images/visual_tool.png differ diff --git a/docs/klotski.md b/docs/klotski.md index 3584357..e1ed36a 100644 --- a/docs/klotski.md +++ b/docs/klotski.md @@ -183,6 +183,11 @@ 性质:最远布局必然存在,且大多数情况下不止一个; +**端点布局**:存在布局Z,对任意不为Z的布局B,有布局A到B的全部`最短路径`中均不存在布局Z,则称布局Z为A的`端点布局`; + +性质:最远布局必为端点布局; + + > 下称满足2 x 2方块在棋盘的最下方中间的布局拥有特征S(即2 x 2块所在位置编号为13,亦或编码以D开头); **布局无解**:布局A所在群中不存在满足`特征S`的布局; @@ -217,6 +222,9 @@ **向前查找**:在第a层存在一节点J,在第a - 1层取得其子布局J'(1个及以上),再将每个J'在第a - 2层取得J''(1个及以上),以此类推直到第0层的根节点,查找的数据即为节点J到根节点的全部最短路径合集,这个过程称为`向前查找`; +![layer_eg](./images/layer_eg.png) + + ### 各参数在层模型中的体现 **最少步数**:某一节点所在层数为其到根节点的最少步数; @@ -227,6 +235,7 @@ **最远布局**:最后一层的全部节点均为最远布局; +**端点布局**:某一节点在第n层,第n + 1层不存在其子布局,即对其做`向后传播`的结果为空集; > 下方特征S的定义与上文一致,且下列讨论均为根节点有解的情况 diff --git a/docs/usage.md b/docs/usage.md index a00184e..d9d2a9f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -1,5 +1,15 @@ ## 命令行参数 ++ 输入的编码可省略后面的`0` +> 'code' will automatically fill '0' to 9 bits + ++ 使用`%`可自动生成文件名 +> use '%' to automatically generate 'file_name' +```bash + eg: ./engine --cal 1A9BF0C00 % + File will save at '1A9BF0C00.txt' +``` + + show命令:根据编码输出实际布局样式 ```bash --show [square_width] @@ -24,6 +34,34 @@ ./engine --cal-target 4FEA13400 43EA73400 demo.txt ``` ++ cal-path命令:计算起始布局到最少步解的所有路径 +```bash + --cal-path + Purpose: Find all of the minimum step solution path of + eg: ./engine --cal-path 4FEA13400 demo.txt +``` + ++ cal-solution-path命令:计算起始布局到全部解的所有路径 +```bash + --cal-solution-path + Purpose: Find all of the solution path of + eg: ./engine --cal-solution-path 1A9BF0C00 demo.txt +``` + ++ cal-farthest-path命令:计算起始布局到最远布局的所有路径 +```bash + --cal-farthest-path + Purpose: Find all of the farthest path of + eg: ./engine --cal-farthest-path 4FEA13400 demo.txt +``` + ++ cal-target-path命令:计算起始布局到指定布局的所有路径 +```bash + --cal-target-path ... + Purpose: Find all of the shortest path from to ... + eg: ./engine --cal-target-path 1A9BF0C00 DAAF4CC00 AE2F2B400 demo.txt +``` + + group命令:计算起始布局的所有衍生情况,即计算其所在群的全部元素 ```bash --group [file_name] @@ -32,6 +70,13 @@ ./engine --group 4FEA13400 demo.txt ``` ++ group-path命令:计算起始布局的所有衍生情况及全部可能的路径 +```bash + --group-path + Purpose: Find all of the path in the group where located + eg: ./engine --group-path 1A9BF0C00 demo.txt +``` + + analy命令:分析布局的具体参数,包括层级结构,层间链接,解与最少步解,最远布局等 ```bash --analy [file_name]