Javascript implementation of custom A-Star algorithm

June 11, 2013 3 min read
JavaScript

Recently I had a lots of interest in Javascript and decided to implement something funny and interesting. For me it was a problem of finding a way through the maze. So, I searched a bit and found that this kind of problems are usually solved with path finding algorithms and one of those is A-Star. After sore investigating I found very good article by Patrick Lester (A-Star Pathfinding for Beginners). My interest progressed to this demo implementation, and it is possible to play with it a bit right here.

So, here are the rules:

  • Double click on the cells to build / erase walls
  • Select cell, then press "Set Start" or "Set Finish" buttons to change start/destination point
  • Click on the "Go!" button to calculate a path.