为什么print无法使用,输出不了任何东西
lua吧
全部回复
仅看楼主
level 1
function CalcPath(closedlist)
--[[ PRE:
closedlist是一个包含检查节点的列表。 如果所有可用节点都已检查,但目标未找到,则为零。
--]]
--[[ POST:
路径(path)是一个列表,包含到目标路径的节点的所有x和y坐标。 或者不存在如果关闭列表无nil
--]]
if closedlist==nil then
return nil
end
local path={}
local pathIndex={}
local last=table.getn(closedlist)
table.insert(pathIndex,1,last)
local i=1
while pathIndex[i]>1 do
i=i+1
table.insert(pathIndex,i,closedlist[pathIndex[i-1]].par)
end
for n=table.getn(pathIndex),1,-1 do
table.insert(path,{x=closedlist[pathIndex[n]].x, y=closedlist[pathIndex[n]].y})
end
for k,v in pairs(path) do
print(path[k][k])
end
closedlist=nil
return path
end
2018年03月12日 12点03分 1
1