Skip to content
/ astart Public

A星算法实现自动寻路的简单实例

Notifications You must be signed in to change notification settings

lgcgo/astart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

例子

功能

// 创建一个12*15的网格区域
a := CreateArea(12, 15)

// 设置路障
a.LockGrid(0, 4)
....
a.LockGrid(4, 12)

// 设置起始点
c := a.GetGrid(1, 14) 
e := a.GetGrid(1, 0)

// 打印地图和路线
a.P(c, e)

输出

# e * # # # # # # # # #
# # * * * # # # # # # #
# # # # * * * # # # # #
# # # # # # * * * * # #
= = = = = = = = = * # #
# # # # # # # # # * # #
# # * * * * * * * * # #
# # * = = = = = = = = =
# # * * * * * * * * # #
= = = = = = = = = * # #
# # # # # # # # = * # #
# # # * * * # # = * # #
# * * * = * * * * * # #
# * # # = # # # # # # #
# s # # = # # # # # # #

About

A星算法实现自动寻路的简单实例

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages