ScratchData LogoScratchData
Back to gtoal's profile

Ultra fast route finding between any two points!

GTgtoal•Created December 12, 2015
Ultra fast route finding between any two points!
24
17
849 views
View on Scratch

Instructions

Click the green flag to generate a maze, then click somewhere in the maze to place a red square and again to place a green square and request a route between them. It uses backpointers to draw a trail back to the origin (at 1,1) from each of two user-selected points: first the green, then the red; then it draws a third path in blue between the two points, this time ignoring the merged part of the trail where both paths overlapped. The BLUE path is the route between the two points. It really is ultra fast - it's just slowed down for the demo. PS Also works on Phosphorus, where the graphics rendering looks nicer: http://phosphorus.github.io/#91330393

Description

LinDoan's amazingly good and fast maze builder plus my new fast maze solving algorithm. LinDoan's maze algorithm generates backpointers to each parent cell as it builds. With a very small change to those pointers (i.e. to make it include the distance to the origin as well as the direction) my path algorithm could be improved in order not to highlight the 'tail' in green which is not part of the route between the two arbitrary points.

Project Details

Project ID91330393
CreatedDecember 12, 2015
Last ModifiedOctober 6, 2016
SharedDecember 13, 2015
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root