Skip to content

Instantly share code, notes, and snippets.

@BrentAureli
Created July 20, 2018 12:31
Show Gist options
  • Save BrentAureli/a90808aa6fd528345a2e4c273cb88c85 to your computer and use it in GitHub Desktop.
Save BrentAureli/a90808aa6fd528345a2e4c273cb88c85 to your computer and use it in GitHub Desktop.
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