A lightweight MoonBit pathfinding library for grid maps and graph search.
moon add Feather119/moon_pathlet map = [
"S....",
".###.",
"...#G",
]
let grid = @moon_path.Grid::from_ascii(map, '#')
let start = @moon_path.Point::{ x: 0, y: 0 }
let goal = @moon_path.Point::{ x: 4, y: 2 }
let result = @moon_path.astar_grid(
grid,
start,
goal,
@moon_path.Neighbors::Four,
@moon_path.Heuristic::Manhattan,
)moon run cmd/grid_mazefound path with cost 6 and 7 nodeslet start = @moon_path.Point::{ x: 0, y: 0 }
let goal = @moon_path.Point::{ x: 4, y: 2 }let grid = @moon_path.Grid::from_ascii([
"S....",
".###.",
"...#G",
], '#')let grid = @moon_path.Grid::open(10, 10)moon check
moon testmoon test --enable-coverage
moon coverage report -f summaryA lightweight MoonBit pathfinding library for grid maps and graph search.