AStar
AStar copied to clipboard
AStar example with community contributions
The demo source link on https://github.com/CodingTrain/AStar/blob/master/README.md is broken ☹
Added options that can increment or decrement rows or columns ![image](https://user-images.githubusercontent.com/26838338/77250986-b874fb80-6c71-11ea-9d5c-9991716d9589.png) ![image](https://user-images.githubusercontent.com/26838338/77250976-9aa79680-6c71-11ea-8949-bc0d114de7d8.png)
I know this is old. But I've recently watched the YouTube video, and realized that you can just use the `winner `(since this is already the index) to splice from...
Implemented A* algorithm to solve the maze. Also added a dom element(button) to generate the maze.
columns and rows were flipped. Very apparent if cols and rows are different from each other. If you create a cols=100 rows=50 maze the resulting grid will be an Array(50)...
Line 101 is repeated at 104.
[https://github.com/CodingTrain/AStar/blame/master/sketch.js](https://github.com/CodingTrain/AStar/blame/master/sketch.js) A Question: Line 15-17 and 23-25 are identical definitions, while I guess it is not intended?! kind regards
Revise #9
Recent versions of ECMAScript include a Set type: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set Indeed, they are required to be implemented in sub-linear time using hash tables or similar.
In order to achieve the best performance, a priority queue should be used for OpenSet. ( O(1) lookup for finding the minimum and O(log(n)) for removing it) As javascript has...