package
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Aug 22, 2020
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Feasible 该点是不是可以走,超出棋盘界限或者已经走过,都不能走.
InitWeight 初始化每个点的权值
初始为0; 对每个点进行探索,若方向可以行,则weight[i][j]++
NextDirection 每次走下一步,选择下一步最少的权值,进行贪心算法
SetWeight 当(x,y)点被占用的时候,当前节点权值设置为9,位置(x,y)周围所有的可行点权值减1
func UnsetWeight(x, y int)
UnsetWeight 回退操作,需要重新计算weight[i][j]的权值,
依次探测周围,若可行,则weight[i][j]++; 其周围可行点的权值+1
Source Files
¶
Click to show internal directories.
Click to hide internal directories.