-
-
Save BrentAureli/a90808aa6fd528345a2e4c273cb88c85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function search(node, trace){ | |
var arr = trace; | |
if(!found){ | |
if(node == null) return; | |
if(node.y == 7 && node.x == 8){ | |
found = true; | |
traceRoute = trace; | |
node.setActive(true) | |
} | |
node.setActive(true) | |
for(var i = 0; i < node.links.length; i++){ | |
if(node.links[i].active == false){ | |
search(node.links[i], arr) | |
} | |
} | |
arr.push(node) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment