An implementation of the A* pathfinding algorithm (translated from the code supplied in this article) in Go, with an additional image generator.
(I'm just a little bit proud of the fact that I came up with the relevant maths in my head and got the code working first try for the image)
- Create a maze in
main.go
and define a start and end point.true
denotes a wall,false
denotes an empty cell. - Run
main.go
. - Observe the path printed to the console and the generated image (blue is the start, green is the end and red is the path taken).