Skip to content

wotbrew/clj-tiny-astar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clj-tiny-astar

Build Status

Little a* pathfinder for 2D binary grids. Diagonals are punished, and distance estimation is performed by default using the manhattan heuristic.

lein:

[clj-tiny-astar "0.1.1-SNAPSHOT"]

Usage:

Clone into a local repository and:

;; this is designed to operate on bounded grids

(clj-tiny-astar/a*
   [4 4] ;;bounds of the grid (width & height)
   my-predicate ;;predicate that takes a point [x y] and returns whether a cell is walkable
   [0 0] ;;from
   [3 3] ;;to)

;;example result, diagonals are punished:

[[0 0] [1 1] [2 2] [3 3]]

the predicate function takes a point (tuple of x and y).

About

Little a* pathfinder for 2D binary grids.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published